I am trying to write a lucene query to retrieve some pages in my website so I have the following:
string.Format("nodeName: ({0})^7 bodyText: ({0})^6", _searchTerm)
which means it will search for content that either has the nodeName
or the bodyText
that includes the _searchTerm
variable
where I am struggling is that I also want it to not include any results that have a hideInNav
flag set to 1
so I tried:
string.Format("nodeName: ({0})^7 bodyText: ({0})^6 +hideInNav: NOT(1)", _searchTerm)
However this is throwing up the following error:
Encountered " <NOT> "NOT "" at line 1, column 140.
Was expecting one of:
"(" ...
"*" ...
<QUOTED> ...
<TERM> ...
<PREFIXTERM> ...
<WILDTERM> ...
"[" ...
"{" ...
<NUMBER> ...
As far as I can tell the query does have a (
after the NOT so I'm stumped as to where this is being expected