I want to run near by query so that the terms are not returned as results if they are within two separate sentences. How can I specify this in Elasticsearch?
I am using wikipedia river plugin to index data.
Thanks for sharing your thoughts.
~R
I want to run near by query so that the terms are not returned as results if they are within two separate sentences. How can I specify this in Elasticsearch?
I am using wikipedia river plugin to index data.
Thanks for sharing your thoughts.
~R
One solution is to index each sentence individually as a separate instance
of a field. You would need to use the position increment gap setting to
artificially add a large gap between sentences. Then when you search with a
near query, you need to provide a slop less then the gap increment used.
Cheers,
Ivan
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.