Thanks for your reply.

How can I support suffix search?

Name: Hello_world
Search: *world

And I'll get hello_world as a result.

Thanks in advance.



-----Original Message-----
From: Shawn Heisey [mailto:s...@elyograg.org] 
Sent: Wednesday, June 11, 2014 5:47 PM
To: solr-user@lucene.apache.org
Subject: Re: Solr search

> Hi,
>
> Any suggestion for tokenizer / filter / other solutions that support 
> search in Solr as following -
>
> Use Case
>
> Input
>
> Solr should return
>
> All Results
>
> *
>
> All results
>
> Prefix Search
>
> Text*
>
> All data started by Text* (Prefix search)
>
> Exact Search
>
> "Auto Text"
>
> Exact match. Only Auto Text
>
> Partial (substring)
>
> *Text*
>
> All strings contains the text
>
>
> Now I'm using KeywordTokenizerFactory and WordDelimiterFilterFactory.
>
> My issue is with exact search:
> When I have document named hello_world, and I'm trying to do Exact 
> Search of hello, I got "hello_world" as a result (I want to get only 
> hello named doccuments).

The WordDelimeterFilter will split on the underscore, which means that the term 
"hello" is in the index for that document. Leave that filter out if you really 
do want an exact match.

Searching for "*" by itself is not how you match all documents. It may work, 
but it is a wildcard search, which means under the covers that it's a search 
for every term in the index for that field. It's SLOW. The special shortcut *:* 
(this must be the entire query with no field name, and I'm assuming the 
standard query parser here) is what you want for all documents. In terms of 
user input, this is what you want to use when the user leaves the search box 
empty. If you're using dismax or edismax, then you would send an empty q 
parameter or leave it off entirely, and define a default q.alt parameter in 
solrconfig.xml, set to *:* for all docs.

Thanks,
Shawn





Email secured by Check Point

Reply via email to