I want to match only documents which match all positions.
My approach would be to index the number of positions and compare it to the
number of matched positions.
Every position that has multiple tokens (stacked tokens) should count only
as 1.
Given the following positions in a field: Position 1: red Position 2: car, automobile
I want to match only documents which match all positions.
My approach would be to index the number of positions and compare it to
the number of matched positions.
Every position that has multiple tokens (stacked tokens) should count only
as 1.
Given the following positions in a field: Position 1: red Position 2: car, automobile
The position is determined by the PositionIncrementAttribute in a Lucene
TokenStream.
So when I say multiple tokens at the same position, I mean tokens that have
a positionIncrement of 0.
These tokens are generated by a SynonymFilter for example, which expands
all synonyms. All these synonyms would have the same position.
In my example "car" and "automobile" are synonyms which are expanded.
On Tuesday, July 1, 2014 2:11:17 PM UTC+2, vineeth mohan wrote:
Hello Dany ,
I didnt really understand what you mean by position.
Kindly clarify.
Thanks
Vineeth
On Tue, Jul 1, 2014 at 5:18 PM, Dany Gielow <dany....@gmail.com
<javascript:>> wrote:
Hello,
I want to match only documents which match all positions.
My approach would be to index the number of positions and compare it to
the number of matched positions.
Every position that has multiple tokens (stacked tokens) should count
only as 1.
Given the following positions in a field: Position 1: red Position 2: car, automobile
In the scripting in function_score , you can access the position and the
use this programatically to find the score.
I have done an example usage above and it works in the latest version.
The position is determined by the PositionIncrementAttribute in a Lucene
TokenStream.
So when I say multiple tokens at the same position, I mean tokens that
have a positionIncrement of 0.
These tokens are generated by a SynonymFilter for example, which expands
all synonyms. All these synonyms would have the same position.
In my example "car" and "automobile" are synonyms which are expanded.
On Tuesday, July 1, 2014 2:11:17 PM UTC+2, vineeth mohan wrote:
Hello Dany ,
I didnt really understand what you mean by position.
Kindly clarify.
I want to match only documents which match all positions.
My approach would be to index the number of positions and compare it to
the number of matched positions.
Every position that has multiple tokens (stacked tokens) should count
only as 1.
Given the following positions in a field: Position 1: red Position 2: car, automobile
What approach should I use to get the number of matched positions as a
score?
I guess I need a custom similarity for that.
Thanks in advance
Dany
--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.
In the scripting in function_score , you can access the position and the
use this programatically to find the score.
I have done an example usage above and it works in the latest version.
On Tue, Jul 1, 2014 at 5:59 PM, Dany Gielow <dany....@gmail.com
<javascript:>> wrote:
Hi Vineeth,
The position is determined by the PositionIncrementAttribute in a Lucene
TokenStream.
So when I say multiple tokens at the same position, I mean tokens that
have a positionIncrement of 0.
These tokens are generated by a SynonymFilter for example, which expands
all synonyms. All these synonyms would have the same position.
In my example "car" and "automobile" are synonyms which are expanded.
On Tuesday, July 1, 2014 2:11:17 PM UTC+2, vineeth mohan wrote:
Hello Dany ,
I didnt really understand what you mean by position.
Kindly clarify.
I want to match only documents which match all positions.
My approach would be to index the number of positions and compare it to
the number of matched positions.
Every position that has multiple tokens (stacked tokens) should count
only as 1.
Given the following positions in a field: Position 1: red Position 2: car, automobile
What approach should I use to get the number of matched positions as a
score?
I guess I need a custom similarity for that.
Thanks in advance
Dany
--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.
In the scripting in function_score , you can access the position and the
use this programatically to find the score.
I have done an example usage above and it works in the latest version.
The position is determined by the PositionIncrementAttribute in a Lucene
TokenStream.
So when I say multiple tokens at the same position, I mean tokens that
have a positionIncrement of 0.
These tokens are generated by a SynonymFilter for example, which expands
all synonyms. All these synonyms would have the same position.
In my example "car" and "automobile" are synonyms which are expanded.
On Tuesday, July 1, 2014 2:11:17 PM UTC+2, vineeth mohan wrote:
Hello Dany ,
I didnt really understand what you mean by position.
Kindly clarify.
I want to match only documents which match all positions.
My approach would be to index the number of positions and compare it
to the number of matched positions.
Every position that has multiple tokens (stacked tokens) should count
only as 1.
Given the following positions in a field: Position 1: red Position 2: car, automobile
What approach should I use to get the number of matched positions as a
score?
I guess I need a custom similarity for that.
Thanks in advance
Dany
--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com.
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.