Hi Ahmet, Yes, thanks... that did come to mind and is the strategy I'm playing with.
However, if you are giving a user a plain text field and using the Lucene query parser, it doesn't create optional clauses for boosting purposes. Does this imply that anyone wanting to use Lucene in conjunction with an input field needs to write a custom query parser if they want reasonable results? ----- On Jun 24, 2016, at 12:25 PM, Ahmet Arslan <iori...@yahoo.com.INVALID> wrote: > Hi Daniel, > You can add optional clauses to your query for boosting purposes. > for example, > temperate OR climates OR "temperate climates"~5^100 > ahmet > On Friday, June 24, 2016 5:07 PM, Daniel Bigham <dani...@wolfram.com> wrote: > Something significant that I've noticed about using the default Lucene > query parser is that if your user enters a query like: > "temperate climates" > ... it will get turned into an OR query: > temperate OR climates > This means that a document that contains the literal substring > "temperate climates" will be on equal footing with a document that > contains "temperate emotions may go a long way to keeping the peace as > we continue to discuss climate change". > So far as I know, your typical search engine definitely does not ignore > the relative positions of terms. > And so my question is -- how do people typically deal with this when > using Lucene? What is wanted is a query that desires search terms to be > close together, but failing that, is ok with the terms simply occurring > in the document. > And again -- the ultimate desire isn't just to construct a Query object > to accomplish that, but to hook things up in such a way that a user can > enter a query in an input box and have the system take their flat string > and turn it into an intelligent query that acts somewhat like today's > modern search engines in terms of wanting terms to be close to each other. > This is such a "basic" use case of a search system that I'm tempted to > think there must be well worn paths for doing this in Lucene. > Thanks, > Daniel > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org