Try to fix search quer

This commit is contained in:
KMY 2023-09-17 10:23:36 +09:00
parent bb3168e5b8
commit 43bc0b4cac

View file

@ -349,13 +349,7 @@ class SearchQueryTransformer < Parslet::Transform
end end
def to_query def to_query
if @statuses_index_only if @negated
if @negated
{ bool: { must_not: [{ term: { _index: StatusesIndex.index_name } }, { @type => { @filter => @term } }] } }
else
{ bool: { must: [{ term: { _index: StatusesIndex.index_name } }, { @type => { @filter => @term } }] } }
end
elsif @negated
{ bool: { must_not: { @type => { @filter => @term } } } } { bool: { must_not: { @type => { @filter => @term } } } }
else else
{ @type => { @filter => @term } } { @type => { @filter => @term } }