Using Solr 4.0, I have a field Title_t(to store titles of books) which is of type TextField. Assuming that these are the following titles stored in my db:
- Physics Guide
- Tutorial on Theoretical Physics
- The General Physics Book
If one wants to search for a title "Physics Guide", then one could use Title_t:physics G* this shows up all results
- Physics Guide
- Tutorial on Theoretical Physics
- The General Physics Book
Now, to my question:
Why isnt the filter not showing only the "Physics Guide" result? Since the search criteria is "physics G*" and not "*physics G *", only one result should be displayed .Is there a way to preserve order in the search key word?
After parsing you query
Title_t:physics G*
will become likedf here is default field(usually it will be text, check your config files). and default operator will OR. so it returns documents with Title_t having term 'physics' and documents with any fields copied default field with words starting with G.
Try with ComplexPhraseQueryParser