Skip to content

NullPointException using span_multi fuzzy query #53118

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

Closed
GeorgeAp opened this issue Mar 4, 2020 · 2 comments
Closed

NullPointException using span_multi fuzzy query #53118

GeorgeAp opened this issue Mar 4, 2020 · 2 comments
Labels
:Search/Search Search-related issues that do not fall into other categories

Comments

@GeorgeAp
Copy link

GeorgeAp commented Mar 4, 2020

Elasticsearch version (bin/elasticsearch --6.8.2)

JVM version (1.8.0_242)

OS version (18.04.1-Ubuntu)

Description of the problem including expected versus actual behavior:
Running the query below yields NullPointException on a one node cluster indexed with two documents.

curl -H'Content-Type: application/json' -XGET "localhost:9200/_search?pretty" -d '
{
  "query": {
    "bool": {
      "filter": [
        {
          "span_near": {
            "clauses": [
              {
                "span_term": {
                  "description":"deposition"
                }
              },
              {
                "span_multi": {
                  "match": {
                    "fuzzy": {
                      "description": {
                        "value": "foobarbaz"
                      }
                    }
                  }
                }
              }
            ]
          }
        }
      ]
    }
  }
}'

Documents used
I indexed the two documents below on the single node.

{"index": {"_index": "cb-6f24372d6c504f9a86f279d564bbad03-deposition", "_type": "doc", "_id": "0008c2f77ab24e7abfbdc42a32927631"}}
{"id":"0008c2f77ab24e7abfbdc42a32927631","case_id":"6f24372d6c504f9a86f279d564bbad03","deposition_date":"2019-03-01","action_metadata":{"user_id":"97817a7034e64108b9c4174e4daf39f1","created_on":"2020-02-19T17:53:25.388000-06:00"},"last_action_metadata":{"user_id":"97817a7034e64108b9c4174e4daf39f1","created_on":"2020-02-19T17:53:25.388000-06:00"},"case_witness_id":"3aef25d14a614f0a8704e95573ae176d","deposition_doc_count":1,"selection_count":1,"applied_tag_count":0,"applied_note_count":0,"sort_values":{"case_witness_first_name":"Jim","case_witness_last_name":"Smith","case_witness_case_impact":2,"case_witness_party_affiliation":"Defendant"},"@culled":false,"@version":1,"deposition_doc_count_by_type":[{"document_count":1,"deposition_doc_type":"TRANSCRIPT"}]}
{"index": {"_index": "cb-6f24372d6c504f9a86f279d564bbad03-case-witness", "_type": "doc", "_id": "3aef25d14a614f0a8704e95573ae176d"}}
{"id":"3aef25d14a614f0a8704e95573ae176d","case_id":"6f24372d6c504f9a86f279d564bbad03","depositions_count":1,"description":"CaseWitness1","case_impact":2,"notes":"Abignarrative","party_affiliation":"Defendant","is_expert":true,"area_of_expertise":"practicallyeverything","witness_id":"0a5df20c0207487fa6b1a31e7577b890","first_name":"Jim","last_name":"Smith","full_name":"JimSmith","@culled":false,"@version":1}

Steps to reproduce:

  1. Start a one node cluster on Elasticsearch 6.8.2 with the two documents above.
  2. Execute the query above.
  3. NullPointException occurs on every run.

Error log

Caused by: java.lang.NullPointerException
	at org.apache.lucene.search.FuzzyTermsEnum.<init>(FuzzyTermsEnum.java:119) ~[lucene-core-7.7.0.jar:7.7.0 8c831daf4eb41153c25ddb152501ab5bae3ea3d5 - jimczi - 2019-02-04 23:16:28]
	at org.apache.lucene.search.FuzzyQuery.getTermsEnum(FuzzyQuery.java:154) ~[lucene-core-7.7.0.jar:7.7.0 8c831daf4eb41153c25ddb152501ab5bae3ea3d5 - jimczi - 2019-02-04 23:16:28]
	at org.apache.lucene.search.MultiTermQuery$RewriteMethod.getTermsEnum(MultiTermQuery.java:78) ~[lucene-core-7.7.0.jar:7.7.0 8c831daf4eb41153c25ddb152501ab5bae3ea3d5 - jimczi - 2019-02-04 23:16:28]
	at org.elasticsearch.common.lucene.search.SpanBooleanQueryRewriteWithMaxClause$1.collectTerms(SpanBooleanQueryRewriteWithMaxClause.java:95) ~[elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.common.lucene.search.SpanBooleanQueryRewriteWithMaxClause$1.rewrite(SpanBooleanQueryRewriteWithMaxClause.java:75) ~[elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.common.lucene.search.SpanBooleanQueryRewriteWithMaxClause.rewrite(SpanBooleanQueryRewriteWithMaxClause.java:117) ~[elasticsearch-6.8.2.jar:6.8.2]
	at org.apache.lucene.search.spans.SpanMultiTermQueryWrapper.rewrite(SpanMultiTermQueryWrapper.java:121) ~[lucene-core-7.7.0.jar:7.7.0 8c831daf4eb41153c25ddb152501ab5bae3ea3d5 - jimczi - 2019-02-04 23:16:28]
	at org.apache.lucene.search.spans.SpanNearQuery.rewrite(SpanNearQuery.java:251) ~[lucene-core-7.7.0.jar:7.7.0 8c831daf4eb41153c25ddb152501ab5bae3ea3d5 - jimczi - 2019-02-04 23:16:28]
	at org.apache.lucene.search.ConstantScoreQuery.rewrite(ConstantScoreQuery.java:50) ~[lucene-core-7.7.0.jar:7.7.0 8c831daf4eb41153c25ddb152501ab5bae3ea3d5 - jimczi - 2019-02-04 23:16:28]
	at org.apache.lucene.search.BoostQuery.rewrite(BoostQuery.java:81) ~[lucene-core-7.7.0.jar:7.7.0 8c831daf4eb41153c25ddb152501ab5bae3ea3d5 - jimczi - 2019-02-04 23:16:28]
	at org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:686) ~[lucene-core-7.7.0.jar:7.7.0 8c831daf4eb41153c25ddb152501ab5bae3ea3d5 - jimczi - 2019-02-04 23:16:28]
	at org.elasticsearch.search.internal.ContextIndexSearcher.rewrite(ContextIndexSearcher.java:106) ~[elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.search.DefaultSearchContext.preProcess(DefaultSearchContext.java:263) ~[elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.search.query.QueryPhase.preProcess(QueryPhase.java:91) ~[elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.search.SearchService.createContext(SearchService.java:649) ~[elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.search.SearchService.createAndPutContext(SearchService.java:596) ~[elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:387) ~[elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.search.SearchService.access$100(SearchService.java:126) ~[elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:359) [elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.search.SearchService$2.onResponse(SearchService.java:355) [elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.search.SearchService$4.doRun(SearchService.java:1107) [elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:41) [elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:751) [elasticsearch-6.8.2.jar:6.8.2]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.8.2.jar:6.8.2]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_242]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]```


@cbuescher cbuescher added the :Search/Search Search-related issues that do not fall into other categories label Mar 5, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

@jimczi
Copy link
Contributor

jimczi commented Mar 5, 2020

Thanks for reporting @GeorgeAp but this is a duplicate of #52894 so I am going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

No branches or pull requests

4 participants