Foren

lucene search

thumbnail
francesco scamarcio, geändert vor 12 Jahren.

lucene search

Regular Member Beiträge: 104 Beitrittsdatum: 17.08.09 Neueste Beiträge
I am implementing a class to do a search with lucene. I have to search content by tag, but if the label is formed by more than one word, the query did not seek anything.

Example if i have to search a content that has a tags like 'more result'

BooleanQuery.addTerm("assetTags","more result") returns assetTag:more assetTags:result)

how can i do to search the whole word?
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: lucene search

Liferay Legend Beiträge: 14918 Beitrittsdatum: 02.09.06 Neueste Beiträge
thumbnail
Hitoshi Ozawa, geändert vor 12 Jahren.

RE: lucene search

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
Check the following page:
http://lucene.apache.org/core/old_versioned_docs/versions/3_0_1/api/all/org/apache/lucene/queryParser/QueryParser.html

Lucene's default QueryParser.Operator is OR, you'll have to add code to specify it to AND

Before parsing in portal-impl\src\com\liferay\portlet\search\lucene\LuceneHelperImpl.java