Jack Luo
04/25/2024, 9:28 PMtext_match(col, 'abc') AND ( text_match(col, 'def') OR text_match(col, 'ghi') )
vs
( text_match(col, 'abc') AND text_match(col, 'def') ) OR text_match(col, 'ghi')
Both gets optimized into the same query text_match(__mergedTextIndex,'abc AND def OR ghi')) which seems to be the wrong behavior for search.Evan Galpin
04/25/2024, 9:43 PMtext_match(col, '"abc" AND ("ghi" OR "def")')
[1] https://docs.pinot.apache.org/basics/indexing/text-search-support#composite-query-using-boolean-operatorsJack Luo
04/25/2024, 9:49 PMEvan Galpin
04/25/2024, 9:54 PMexplain codepaths responsible for generating a string representation of the queryJack Luo
04/25/2024, 9:57 PMAND operator takes precedence over OR operator. So text_match(col, 'abc') AND ( text_match(col, 'def') OR text_match(col, 'ghi') ) when translated to text_match(__mergedTextIndex,'abc AND def OR ghi')) would definitely be wrong since the generated query would be (abc AND def) OR ghi rather than the intended abc AND (def OR ghi)Evan Galpin
04/25/2024, 9:59 PMEXPLAIN queries. There could be a bug in what’s shown in the EXPLAIN query, while the codepath for executing the query could still be correct.
I don’t know if that’s the case, it could be a bug in query optimization like you said.Jack Luo
04/25/2024, 9:59 PMJack Luo
04/25/2024, 11:20 PM