daledotshan/liferay-portal — pull request #126 by yuhai (2014-11-07 08:55:13+00:00)
Title: LPS-51408  The fields of ddmStructureKey and ddmTemplateKey should use "KeywordAnalyzer"

The fields of ddmStructureKey and ddmTemplateKey are desgined as NOT_ANALYZED in index. That is to say, these fields's value will be stored as a single term. However, the fileds were assigend to StandardAnalyzer and StandardAnalyzer will tokenizes for the two fields in search query. This does not match.

For example, when search the keywords "Hello|World" in Search Portlet, the query will be "ddmStructureKey:hello ddmStructureKey:world" in query grammar after StandardAnalyzer Tokenizes.

For "NOT_ANALYZED" fields, we should use "KeywordAnalyzer". The query will be "ddmStructureKey:Hello|World" after KeywordAnalyzer Tokenizes.

Refer to the link: http://lucene.apache.org/core/3_5_0/api/all/org/apache/lucene/analysis/KeywordAnalyzer.html
http://lucene.apache.org/core/3_5_0/api/all/org/apache/lucene/document/Field.Index.html#NOT_ANALYZED

Thanks,
Hai