cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Lucene Field query with 'No' value

albergquist
Champ in-the-making
Champ in-the-making
In Alfresco 2.1 and 3.1, the Lucene search does not return content on a field search where the property value is 'No', 'no' or 'NO'.   
For example, the query  below does not return any results when I have content with Author specified as "No".  This same query works correctly for other author values.
@cm\:author:"No" 

I have tested this from a custom webscript using the SearchService, the Node Browser Search and the Advanced Search in Alfresco Explorer (using 'No*' since three characters are required).  I have also tested 'NOT Yes' and other similar searches on the particular field with no success. 
Can anyone explain this behavior?  Is it a limitation in Lucene?  I noticed the following forum which seemed it has a chance to be related: http://forums.alfresco.com/en/viewtopic.php?f=4&t=18376.   
Thanks!
3 REPLIES 3

rogier_oudshoor
Champ in-the-making
Champ in-the-making
Lucene tokenizes and manipulates content before it places it inside the index. Most likely, the author "No" will not be present in the indices. You could try turning tokenization off for the given field in the Contentmodel.

albergquist
Champ in-the-making
Champ in-the-making
Thank you so much for your reply– that was the issue. 

For those also experiencing this, please note the following stop words in Lucene Analyzer – these will be removed during tokenization:
"a", "an", "and", "are", "as", "at", "be", "but", "by","for", "if", "in", "into", "is", "it", "no", "not", "of", "on", "or", "s", "such", "t", "that", "the", "their", "then", "there", "these","they", "this", "to", "was", "will", "with"

Please note that "s" and "t" are no longer stop words in Lucene 2.2; however Alfresco 2.1-3.1 use Lucene 2.1.

(Stop words extracted from org.apache.lucene.analysis.StopAnalyzer used by org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser)

qsdmv
Champ in-the-making
Champ in-the-making
If I search "rocket science", I found 40 records (even search "department rocket science", got the same results), I only got one result if I search "department of rocket science". But actually 40 records all have "department of rocket science" precisely but the one result including two "of" stop words like "department of rocket science, office of blah blah". Can someone explains what wrong?

Thanks