Oliver Bayer:
Hi,
take a look at the Indexer classes - in your case the "
com.liferay.journal.util.Indexer" class. While indexing the reindex method is called. The indexed fields are set in the "
getArticleDocument" method. See the following code snippet:
1...
2doc.addText(Field.TITLE, title);
3...
4doc.addText(Field.DESCRIPTION, description);
5...
HTH Oli
Ok I added my new field displayDate and I can order on it.
As I only want article that have an displayDate < current date, I'd like to add an numeric range term or a range term like this :
1 protected BooleanQuery createFullQuery(
2 BooleanQuery contextQuery, SearchContext searchContext) throws Exception{
3 BooleanQuery booleanQuery = super.createFullQuery(contextQuery, searchContext);
4 long now = Calendar.getInstance().getTime().getTime();
5 booleanQuery.addRangeTerm("displayDate", 0L, now);
6 return booleanQuery;
7 }
but it doesn't work. I take a look at the date format in the index and I found for display date this : 20110601195700 so yyyymm.... do you know the helper class that can help me to add the upper bound of my date range correctely ?