Tribune

Home » Liferay Portal » English » 2. Using Liferay » General

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
himanshu jain
Lucene search
6 febbraio 2012 23.10
Risposta

himanshu jain

Punteggio: Junior Member

Messaggi: 34

Data di Iscrizione: 25 ottobre 2011

Messaggi recenti

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
Ram Manusani
RE: Lucene search
14 febbraio 2012 15.24
Risposta

Ram Manusani

Punteggio: Regular Member

Messaggi: 124

Data di Iscrizione: 27 ottobre 2011

Messaggi recenti

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
Hitoshi Ozawa
RE: Lucene search
25 giugno 2012 5.44
Risposta

Hitoshi Ozawa

Punteggio: Liferay Legend

Messaggi: 8000

Data di Iscrizione: 23 marzo 2010

Messaggi recenti

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).
Nikhil Nishchal
RE: Lucene search
21 giugno 2012 22.59
Risposta

Nikhil Nishchal

Punteggio: Junior Member

Messaggi: 74

Data di Iscrizione: 21 giugno 2012

Messaggi recenti

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.
Pranay R Patadiya
RE: Lucene search
23 luglio 2012 23.51
Risposta

Pranay R Patadiya

Punteggio: Regular Member

Messaggi: 173

Data di Iscrizione: 22 febbraio 2010

Messaggi recenti

Hi Himanshu,

Has your search worked?

Thanks,
Pranay