panjiwa10028 / solr-php-client

Automatically exported from code.google.com/p/solr-php-client
Other
0 stars 0 forks source link

Exact match problem in Solr search #17

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
How can i get exact words matches in solr search ?

for e.g When i enter "what is my name" which is already present in database,
I should be getting only "what is my name" but not the others like "what is
...." or "what i am doing rt now ?"

Please help here.

Original issue reported on code.google.com by write2am...@gmail.com on 27 Jul 2009 at 6:24

GoogleCodeExporter commented 8 years ago
This really isn't an issue for the PHP client, its more a general Solr user 
question which you'd get more help 
with from the solr-user mailing group: 
http://lucene.apache.org/solr/mailing_lists.html#Users

I'm going to mark this issue invalid. The final answer to your question will 
depend on how you're indexing the 
field you're searching on, but the simple case sounds like a phrase query to me:

field:"what is my name"

using quotes to denote that the terms should be in order and near one another 
in the field value (just like 
you'd search for phrases on any search engine).

For more information on the different syntaxes for searches see: 
http://wiki.apache.org/solr/SolrQuerySyntax 
and http://lucene.apache.org/java/2_4_0/queryparsersyntax.html (lucene query 
parser is used by default)

If you need more help please see the solr documentation or submit your question 
to the solr user mailing 
group

Original comment by donovan....@gmail.com on 27 Jul 2009 at 2:16