FTS search with type query string


#1

Hi,

I have created the FTS index and trying to search a string and unable to get the desired output.

I have JSON documents which contains key say “name” and different values for it say “wl eval”, “wl rem” “wl dep” etc. Note these values are phrases. Now I am trying to search a string in these documents having field ”name:wl eval” or “name:wl rem”

Following are few search queries and their results.

Query 1: '+rh_wl72 +name:“wl eval” +status:critical|ok ’
Result 1: The above query returns the documents containing string “rh_wl72” where name field is “wl eval” AND status field is “critical” OR “ok”

Query 2: '+rh_wl72 +name:“wl eval”|”wl rem” +status:critical|ok ’
Result 2: The above query 2 also returns the same result as result 1 and does not include the documents where name field is “wl rem”

I was expecting the result 2 containing documents having string “rh_wl72” where name field is “wl eval” OR “wl rem” AND status field is “critical” OR “ok”. Basically the documents with name field having value “wl rem” are not included. How do I make query 2 to results to include documents with name field having value “wl rem” also?

Regards,
Ketan


#2

@shriniketan You’re original query should’ve looked like this:

+key:"rh_wl72" +name:"wl eval" +status:'"critical"|"ok"'

Here’s how you’re second query should look to work:

+key:"rh_wl72" +name:'"wl eval"|"wl rem"' +status:'"critical"|"ok"'