Is there a way to perform a proximity search that is bounded, not by a fixed number of tokens, but by 2 marker tokens of some kind? For example, to implement proximity queries that are bounded inside as single sentence or paragraph? Obviously the analyzer has to support it, but has this been done before, and how?
相关问题
- JCR-SQL - contains function doesn't escape spe
- Match lucene entire field exact value
- How to rank documents using tfidf similairty in lu
- Lucene Query on a DateField indexed by Solr
- How to token a word which combined by two words wi
相关文章
- Solr - _version_ field must exist in schema and be
- 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
- how to add custom stop words using lucene in java
SpanPositionCheckQuery
is an abstract class that defines a span query, which checks if the matched span passes a check for position. Concrete implementations includeSpanPositionRangeQuery
that checks if the match is in a defined range of positions andSpanPayloadCheckQuery
that checks if the payloads of the matched positions are the same as requested.Maybe you could achieve what you want by assigning a payload to each token indicating to which sentence/paragraph it belongs (with a counter) and then checking if all the payloads of the matched span are equal? I think that extending above class to achieve it should be straightforward.