Fórumok

Set priority for the title - Lucene

thumbnail
Jonatan Oyola, módosítva 9 év-val korábban

Set priority for the title - Lucene

Regular Member Bejegyzések: 193 Csatlakozás dátuma: 2007.06.06. Legújabb bejegyzések
Is it possible to set the weight of priority for the title in the search?

I am using the SearchContext class to generate the query.

Thanks on advance.
thumbnail
Andew Jardine, módosítva 9 év-val korábban

RE: Set priority for the title - Lucene

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
Hey Jonatan.

I've never actually done this myself (in Liferay) but I can see that there is a WeightedWord class as part of the search package. That class appears to have a weight and a word value -- my guess is that if you can figure out how to get it into the query, that'd be what you are looking for. My take a little source code digging though.
thumbnail
Sreeraj AV, módosítva 9 év-val korábban

RE: Set priority for the title - Lucene

Regular Member Bejegyzések: 239 Csatlakozás dátuma: 2010.04.27. Legújabb bejegyzések
Jonatan Oyola:
Is it possible to set the weight of priority for the title in the search?

I am using the SearchContext class to generate the query.

Thanks on advance.


I did a workaround to achieve this.. I have used BooleanQuery in my search..
1. Create the solr Query.
2. Convert the Query to String
3. Replace term:keyword with term:keyword^10
4. Covert the String back to Query
thumbnail
Andew Jardine, módosítva 9 év-val korábban

RE: Set priority for the title - Lucene

Liferay Legend Bejegyzések: 2416 Csatlakozás dátuma: 2010.12.22. Legújabb bejegyzések
Did the SOLR query work with the OOTB Lucene implementation? or are you using a version of Liferay that have been configured to use SOLR in place of Lucene (directly)?
thumbnail
Sreeraj AV, módosítva 9 év-val korábban

RE: Set priority for the title - Lucene

Regular Member Bejegyzések: 239 Csatlakozás dátuma: 2010.04.27. Legújabb bejegyzések
Andew Jardine:
Did the SOLR query work with the OOTB Lucene implementation? or are you using a version of Liferay that have been configured to use SOLR in place of Lucene (directly)?


We have configured Solr with Liferay. I am not sure the same indexer query will work with lucene.