Opened 12 years ago

#946 new defect

Lucene index / always use analyzer

Reported by: fxp Owned by: geonetwork-devel@…
Priority: major Milestone: v2.10.0 RC0
Component: General Version:
Keywords: Cc:

Description

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).

Attachments (1)

946.patch (1.7 KB ) - added by fxp 12 years ago.

Download all attachments as: .zip

Change History (1)

by fxp, 12 years ago

Attachment: 946.patch added
Note: See TracTickets for help on using tickets.