[Brug-talk] Ferret - sphinx - Solr
Peter Vandenabeele
peter at vandenabeele.com
Wed Jan 23 17:19:03 EST 2008
2008/1/21 Peter De Berdt (10-forward) <peter at 10-forward.be>:
> Sadly, sphinx is out of the question, it doesn't support wildcard searches
> as our customers are used to apparently, searches for "pet*" don't return
> "Peter" records for example. I may have missed something, but this is a
> feature we can't live without.
I am now working my way through the Sphinx 0.9.8 config file to put more details
in it than the default test1 / documents example and bumped into this. From the
last line (about backwards compatibility), I may understand that this is a new
feature in the 0.9.8 version.
For Rails integration, it is clear that ultrasphinx and Thinking
Sphinx are competing
for the latest and greatest version (they are very actively maintained).
As a side note, I looked into tsearch2 in postgresql 8.2 ... seems quite simple
an sich, but no up-to-date Rails integration yet. I see tsearch2 now as my
fall-back, since that seem utterly simple to set-up and just code some custom
find function (there is no external indexer etc., just need to write a
trigger in
the postgresql database at update/create to also fill in the ts_vector column).
Back to the * function in sphinx:
# enable_star
#
# this feature enables "star-syntax" in keywords when searching
# through indexes whcih were created with prefix or infix indexing
# enabled.
#
# enable_star only affects searching; so it can be changed
# without reindexing (one would need to restart searchd, though).
#
# possible values are 0 and 1.
#
# the default value is 0, which means to disable star-syntax
# and treat all keywords as prefixes or infixes respectively,
# depending on indexing-time min_prefix_len/min_infix_len settings.
#
# the value of 1 means that
# 1) star can be used at the start and/or the end of the keyword;
# 2) star will match zero or more characters.
#
# for example, assume that the index was built with infixes and
# that enable_star is 1. searching should work as follows:
#
# 1) "abcdef" query will match only those documents which contain
# the exact "abcdef" word in them;
#
# 2) "abc*" query will match those documents which contain
# any words starting with "abc" (including the documents which
# contain the exact "abc" word only);
#
# 3) "*cde*" query will match those documents which contain
# any words which have "cde" characters in any part of the word
# (including the documents which contain the exact "cde" word only).
#
# 4) "*def" query will match those documents which contain
# any words ending with "def" (including the documents which
# contain the exact "def" word only).
#
# optional, default value is 0 (to keep compatibility with 0.9.7).
HTH,
Peter
More information about the Brug-talk
mailing list