How can I do a proximity search for two multi-word phrases in Lucene. For example, I want to find all black lab* (black labrador, black labradoodle, etc) withing 5 words of the phrase "pet shop". Which analyzer should I be using? Which query parser would be recommended? I'm working with Lucene.NET. I've ported the ComplexPhraseQueryParser from Java to C#, but that parser doesn't seem to be doing the trick (or perhaps I'm just using it wrong). I'm just getting started with Lucene, so your help is much appreciated.
相关问题
- JCR-SQL - contains function doesn't escape spe
- Lucene.net 4.8 - IDE doesn't recognize Lucene.
- Match lucene entire field exact value
- How to rank documents using tfidf similairty in lu
- Lucene Query on a DateField indexed by Solr
相关文章
- Solr - _version_ field must exist in schema and be
- Lucene.NET through NHibernate.Search and POCO Enti
- CakePHP with Lucene
- Apache Lucene doesn't filter stop words despit
- Sort by date in Solr/Lucene performance problems
- What Solr tokenizer and filters can I use for a st
- Solr: How to dynamically elevate limited number of
- Finding a single fields terms with Lucene (PyLucen
You can use a SpanQuery for this:
The default Lucene
QueryParser
doesn't support span queries, but you could try the Surround query parser. I couldn't find much else in the way of documentation.You may also find this answer and this blog post useful.
You just need to set the slop.