Intervals wildcard 128 expansion limit

Hi,

I'm trying out intervals wildcard queries. But in the process, depending on the term I'm hitting the 128 expansion limit. I know that this is a hard limit imposed by Lucene. But my question is if I have to get past it, how do I (Any alternate way)?

This is for the middle wildcards (e.g. exa*le), so prefixing/ngraming wouldn't work.

Thanks,
P

To elaborate more on the use case, let's say, I've got a query *ad*ed* on a field called description. Now, we also have description data indexed in sub-field using ngram filter (to avoid leading and trailing wildcards).

So the equivalent ES query gets created as

GET documents/_search
{
  "_source": "description",
  "size": 10,
  "query": {
    "intervals": {
      "description": {
        "any_of": {
          "intervals": [
            {
              "all_of": {
                "ordered": true,
                "max_gaps": 0,
                "intervals": [
                  {
                    "match": {
                      "query": "toy"
                    }
                  },
                  {
                    "wildcard": {
                      "pattern": "ad*ed",
                      "use_field": "description._ngram"
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    }
  }
}

The above easily throws 128 expansions limit.

I see that Lucene does provide an overridden method to pass an integer as an argument. Can we have something in the method to call that overridden method here?

Also, is there any way to provide say top N (50/100/128) expanded terms instead of throwing an error?

@Alexander_Reelsen @philippk @Alan_Woodward

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.