The standard lucene search build a query like this:
(contents:british*) AND (path:1052s* OR path:1053s*)
This searches for the phrase "british" in nodes under 1052 and media nodes under 1053. I want to extend this to EXCLUDE certain nodes. The query i have generated looks like this but does not work. Any ideas what is wrong? 1076 is under 1052 but i want this branch excluded from the results.
(contents:british*) AND (path:1052s* OR path:1053s* (NOT path:1076s*))
The syntax is as follows. I have not integrated this into the Lucene Search for Umbraco 3. It would be a useful addition to the Search for Umbraco 4 i think.
(contents:welfare*) AND (path:1052s* OR path:1053s* NOT path:1052s1075s* NOT path:1052s1076s* NOT path:1052s1074s*)
This will search for the word "Welfare" in node path 1052 or media node 1053 but EXCLUDE any paths with 1076 or 1074.
Lucene search query syntax
Hi
The standard lucene search build a query like this:
This searches for the phrase "british" in nodes under 1052 and media nodes under 1053. I want to extend this to EXCLUDE certain nodes. The query i have generated looks like this but does not work. Any ideas what is wrong? 1076 is under 1052 but i want this branch excluded from the results.
Dan,
Not an expert at this but don't you need an additional OR or AND before the NOT path?
Cheers,
/Dirk
Dan,
Dont know if you are already using it but luke helps alot when testing queries.
Regards
Ismail
I have tried with and without. The documentation suggests AND is not needed:
http://lucene.apache.org/java/2_3_2/queryparsersyntax.html
The syntax is as follows. I have not integrated this into the Lucene Search for Umbraco 3. It would be a useful addition to the Search for Umbraco 4 i think.
(contents:welfare*) AND (path:1052s* OR path:1053s* NOT path:1052s1075s* NOT path:1052s1076s* NOT path:1052s1074s*)
This will search for the word "Welfare" in node path 1052 or media node 1053 but EXCLUDE any paths with 1076 or 1074.
Dan
is working on a reply...