How to write DtSearchConverter, NotSpanQuery in elastic?


how can I write NotSpanQuery which is not the same as SpanNotQuery in Elastic?

How can I write a query like this in elastic: QueryA AND NOT QueryB
what I want to rewrite it as QueryA NOT W/Integer.MAX_VALUE QueryB ?

Also how can I write QueryA OR NOT QueryB
what I want to write as QueryA OR * NOT W/Integer.MAX_VALUE QueryB?

Or if I have a proximity query like QueryA w/50 NOT QueryB
how can I rewrite that as QueryA w/50 (* w/Integer.MAX_VALUE QueryB) - which is the same as OR NOT?

So generally what I would like to earn to create a DtSearch Parser with Elastic Queries?
Do anyone has a kind of like that parser which can be shared with us? Or can help with sharing ideas on that?

I have seen a plugin what can be used to create a DtSearch Parser but this is used for SolR with Lucene Queries and I would like use Elasticsearch with Nest Query Visitor and this is where I need Your help.

How can we use a visitor like that with Nest Queries?
What are the elastic Query equivalents for the Lucene ones used in that visitor like NotSpanQuery?


I saw a topic in this community which is helpful for combining queries with Boolean Query:

Is there a way to see other examples like I mentioned above working as combining nested queries?

  • QueryA AND NOT QueryB
  • QueryA OR NOT QueryB
  • QueryA w/50 NOT QueryB


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