Proximity in Query


(Kartavya) #1

Hi

I have implemented proximity query as below.
{
"query" : {
"bool" : {
"should" : {
"query_string" : {
"field" : "Title",
"query" : ""ELASTIC SEARCH"~3"
}
}}
}
}

How can I implement it like below

{
"query" : {
"bool" : {
"should" : {
"field" : {"Title" : ""ELASTIC SEARCH OR LUCENE SEARCH OR (A AND
B)"~3" }
}
}
}
}

Please Suggest.

Thanks,

--


(Igor Motov) #2

I am not sure I understand what you are trying to achieve. Could you,
perhaps, give an example? Would something like this work for you?

"ELASTIC SEARCH"~3 OR "LUCENE SEARCH"~3 OR (A AND B) ?

On Monday, October 22, 2012 2:06:07 AM UTC-4, kartavya wrote:

Hi

I have implemented proximity query as below.
{
"query" : {
"bool" : {
"should" : {
"query_string" : {
"field" : "Title",
"query" : ""ELASTIC SEARCH"~3"
}
}}
}
}

How can I implement it like below

{
"query" : {
"bool" : {
"should" : {
"field" : {"Title" : ""ELASTIC SEARCH OR LUCENE SEARCH OR (A AND
B)"~3" }
}
}
}
}

Please Suggest.

Thanks,

--


(balaa.gs) #3

Hi

 i am having the same doubt which you have asked.

 is there any possibility to work like below query

 ((A OR B) AND (C OR D)~5)

Ex:
my expected result = (A OR B) within 5 words of (C OR D)

   if A is the result of first group, C is the result of 2nd group, then A should be with in 5 words of C.

(system) #4