Foren

Lucene search

thumbnail
himanshu jain, geändert vor 12 Jahren.

Lucene search

Junior Member Beiträge: 34 Beitrittsdatum: 25.10.11 Neueste Beiträge
How to implement Lucene search in liferay.I implement search but its using the default one like wiki,blogs etc.I am using mysql db nw i want to search the contents from my database.I try with the docs but not able to achieve dis successfully .Can anyone help me from the beginning step till the final result for implementing this solution.
Thanks in Advance
thumbnail
Ram Manusani, geändert vor 12 Jahren.

RE: Lucene search

Regular Member Beiträge: 124 Beitrittsdatum: 27.10.11 Neueste Beiträge
Liferay by default provides many portlets to support Open Search Framework such as Message Bords, Blogs, Wikis, Directory and Doc. Library, Users, etc.

These portlets have OpenSearch framework Conf. like
<open-search-class>class-name</open-search-class>

Liferay by default sets Lucene to false for faster performance in portal.properties

you should probably change them in portal-ext.properties

index.read.only=false
index.on.startup=false

You probably need to change it to true and change your indexer class to the class name

Example like:
<indexer-class>com. liferay.test.search.Indexer</indexer-class>

This should help you to start with
thumbnail
Hitoshi Ozawa, geändert vor 11 Jahren.

RE: Lucene search

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
Shouldn't set index.read.only=true because this will result in lucene not being updated. This setting is usually just used in clustered environment
where all writes are to one server (master-slave setup).
thumbnail
Nikhil Nishchal, geändert vor 11 Jahren.

RE: Lucene search

Regular Member Beiträge: 176 Beitrittsdatum: 22.06.12 Neueste Beiträge
Hello Himanshu,
Lucene search is based on indexer search.
Liferay provide us different ways to use lucene search to make fetching result fast.
For our own model we can also create its own indexer if required.

For running liferay indexer model like journalArticle blogs etc.. we can use different Query patter to fetch result in customized way.
We can user query like TermQuery, BolleanQuery etc.
and latter we can get excute those query to search ustil to get Hits.

Hits hits = null;
try {
hits = SearchEngineUtil.search(companyId, yourCustomQuery, startIndex, endIndex);
} catch (SearchException ex) {
LOGGER.error("Error occured during company search", ex);
}

Further you can get document through these hits.

By this way we can achieve as per our required result.
thumbnail
Pranay R Patadiya, geändert vor 11 Jahren.

RE: Lucene search

Regular Member Beiträge: 177 Beitrittsdatum: 23.02.10 Neueste Beiträge
Hi Himanshu,

Has your search worked?

Thanks,
Pranay