[GeoNetwork-devel] [GeoNetwork opensource Developer website] #946: Lucene index / always use analyzer

#946: Lucene index / always use analyzer
---------------------+------------------------------------------------------
Reporter: fxp | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.9.0
Component: General | Version:
Keywords: |
---------------------+------------------------------------------------------
Add a !LowerCaseKeywordAnalyzer class to index keywords as lowercase to
allow case insensitive searches, but seem adding
{{{
<Field name="keyword"
analyzer="org.fao.geonet.kernel.search.LowerCaseKeywordAnalyzer"/>
}}}
to config-lucene.xml doesn't work at all.

In LQB addRequiredTextField method this code seem preventing the analyzer
to be executed as keyword is not (and should not) defined in
tokenizedFieldSet, so for non tokenized fields seem the value is not
analyzed? (else condition calls textFieldToken that calls analyzer
properly):

{{{
if (!_tokenizedFieldSet.contains(luceneIndexField)) {
         // TODO : use similarity when needed
         TermQuery termQuery = new TermQuery(new Term(luceneIndexField,
searchParam));
         BooleanClause clause = new BooleanClause(termQuery, occur);
         query.add(clause);
}
else {
         // tokenize searchParam only if tokenized when indexing
         StringTokenizer st = new StringTokenizer(searchParam,
STRING_TOKENIZER_DELIMITER);
}}}

Analyzers should be used in all cases (tokenized or not).

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/946&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.