HI All,
I have created an index and my basic query starts:
GET kmnewindex/_search
{
"query": { "query_string": {"query": "going home", "fields": ["squestion", "ssubject"]}
},
"_source": ["idisid", "itopid" ,"ipid", "ssubject", "dcreated", "squestion", "suserhrid","suserfname","susersname","stopname"]
}
I want to expand on this search, but don't think that parent/child relationship or span will do what I want.
In SQL my next step would be:
SELECT x.idisid, x.ipid
FROM kmnewindex x
WHERE x.ipid= 0
UNION ALL
SELECT MIN(y.idisid) AS idisid, y.ipid
FROM kmnewindex y
GROUP BY y.ipid
HAVING NOT y.ipid= 0
Then I want to return all from the original query where idisid from my second query isn't in the original set where its equal to ipid.
SO what I really want to do is store the first and second query in variables then use both in a new query.