Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lucene CustomScoreQuery not enumerating long primitives #26830

Closed
ghost opened this issue Sep 29, 2017 · 1 comment
Closed

Lucene CustomScoreQuery not enumerating long primitives #26830

ghost opened this issue Sep 29, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 29, 2017

Elasticsearch version (bin/elasticsearch --version): Version: 5.6.1, Build: 667b497/2017-09-14T19:22:05.189Z, JVM: 1.8.0_144

Plugins installed: [custom plugin]

JVM version (java -version): 1.8

OS version (uname -a if on a Unix-like system): #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:
I've written a custom Lucene CustomScoreQuery subclass that is expected to: (1) classify documents using a long field type as matched or not, (2) score the hit documents using another long field type. The problem I am facing is that the CustomScoreQuery's subquery is not iterating through the terms of the given field. If I change the field type from long to keyword for example, the getTermsEnum() function of the subquery is executed and a FilteredTermsEnum instance is returned, which is the expected behaviour. In addition, I've used the plugin successfully in Apache Solr, however the same does not imply to Elastic. The most important implementation details may be found here.

The index mapping I've defined is as follows:

{
  "images" : {
    "mappings" : {
      "descriptors" : {
        "properties" : {
          "image_descriptor_long" : {
            "type" : "long"
          },
          "image_descriptor_short" : {
            "type" : "long"
          }
        }
      }
    }
  }
}

@jimczi
Copy link
Contributor

jimczi commented Sep 29, 2017

@dsafaric I answered on the forum directly, thanks for opening the discussion. I am going to close this issue because we reserve github for confirmed bugs and feature requests, we can continue the discussion on the forum.

@jimczi jimczi closed this as completed Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant