Simple NOT searching

Project:RUcore/NJDH/Partner Portal Search
Component:API - Search API
Category:bug report

Simple NOT searching does not work: in a phrase such as [term] NOT [term], “not” is searched as a keyword, but not treated as a Boolean operator.



The not function does treat "not" the same as "NOT", but it is still flakey having to do with the PHP array_diff function. This is probably a rather deep bug and will need careful study - and the time to do that;-)


Version:5.0» 5.1


Version:5.1» 5.2
Assigned to:triggs» chadmills

NOT searching is not natively supported by our current search engine, Amberfish. A workaround would not be ideal under the current circumstances. This is because for every NOT operator in a search query a search would need to be performed and then compared to the rest of the query results with objects getting removed when needed, trimming down the list. This might spin out of control if multiple NOT operators are used in a search. Would like to consider closely for r5.2 and if not resolution found, ensure the rollout of Lucene in place of Amberfish support NOT searching.


We need a search interface that allows the searcher to choose a "NOT" option in addition to "AND" and "OR". Possible testing examples:

rights NOT digital

rights NOT human NOT civil

The proper implementation of this feature should not require the searcher to supply the "NOT" in the search string, as in my clumsy examples above.


Version:5.2» 5.2.1
Component:Searching» API - Search API

Moving to next release when the search engines changes. Currently this is not something Amberfish does natively and the work around would be to perform multiple queries and cross compare the results. This is not ideal because of the slowness currently experienced, performing multiple queries would just make the slowness far worse.


Version:5.2.1» 6.1
Status:active» test

Implemented with Solr release. In the search displays the option to choose NOT is now available. Test using different searches.


Status:test» active

Please add NOT to the search form. "NOT" is not currently available in RUcore search interface, only "AND" and "OR" are available. It is available in NJDH.


Status:active» test

Added, sorry about that.


Assigned to:chadmills» rmarker

I tested NOT search for and it seems to work OK now.

I first searched for "new jersey" and the results list had 11593 records. The third record was Workers in NJ history.

Then I did "new jersey" NOT "workers" and the results list had in 11279 records. The third record in my previous search was not in the results list.
I will wait for Rhonda to sign off on this bug.


Assigned to:rmarker» chadmills

On the test server in the ALL portal, I searched "new jersey" and got 1239 records. The third record had the word "green" in the title.

I did "new jersey" and chose the NOT operator from the pull-down and entered "green" in the second search box. I got 1235 records and the "green" title was not on the list.

I then did a search in one search box of "new jersey NOT green" and got the same 1235 record result list.

I then did a search in one search box of "new jersey not green" and got zero results. We need to make sure that the HELP tab includes instructions for using AND-OR-NOT operators. The user can choose the pull-down AND, OR, NOT, or can enter the AND, OR, NOT words such as boy OR girl, but must capitalize the operators in that case.

Here is the replacement (default) text for the "Boolean search" paragraph in the Help tab:
'AND-OR-NOT search: A search for "boy" OR "girl" will find items containing "boy" or items containing "girl", whereas a search for "boy" AND "girl" will find items containing both "boy" and "girl". A search for "boy" NOT "girl" will find items containing "boy" excluding any items containing "girl". The supplied AND-OR-NOT drop-down can be used, or the words AND, OR, NOT in all-caps can be supplied, as in "boy AND girl". Mixed AND-OR-NOT searches such as "boy AND girl OR lass" are not supported.'


Assigned to:chadmills» rmarker

I updated the "boolean search" help information as requested. Please let me know if it satisfies your needs.

<a href="" title=""></a>


Assigned to:rmarker» ananthan
Status:test» fixed

The updated help text that explains the boolean operators appears in the Help on RUcore and also on NJDH (which also uses the default Help text). Verified fixed.


Status:fixed» closed

Back to top