• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

java.lang.RuntimeException: no terms in field post.id - cannot determine sort type

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I have JForum 2.1.8 and when I try to search something and I do not use the "relevance" sorting option but "message date" I get the following error

08:58:25,934 ERROR [ExceptionWriter ] net.jforum.exceptions.ForumException: java.lang.reflect.InvocationTargetExcept
ion
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.jforum.Command.process(Command.java:114)
at net.jforum.JForum.processCommand(JForum.java:219)
at net.jforum.JForum.service(JForum.java:202)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.reflect.InvocationTargetException
... 23 more
Caused by: net.jforum.exceptions.SearchException: java.lang.RuntimeException: no terms in field post.id - cannot determi
ne sort type
at org.apache.lucene.search.FieldCacheImpl$11.createValue(FieldCacheImpl.java:436)
at org.apache.lucene.search.FieldCacheImpl$Cache.get(FieldCacheImpl.java:72)
at org.apache.lucene.search.FieldCacheImpl.getAuto(FieldCacheImpl.java:424)
at org.apache.lucene.search.FieldSortedHitQueue.comparatorAuto(FieldSortedHitQueue.java:338)
at org.apache.lucene.search.FieldSortedHitQueue$1.createValue(FieldSortedHitQueue.java:172)
at org.apache.lucene.search.FieldCacheImpl$Cache.get(FieldCacheImpl.java:72)
at org.apache.lucene.search.FieldSortedHitQueue.getCachedComparator(FieldSortedHitQueue.java:155)
at org.apache.lucene.search.FieldSortedHitQueue.<init>(FieldSortedHitQueue.java:56)
at org.apache.lucene.search.TopFieldDocCollector.<init>(TopFieldDocCollector.java:41)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:122)
at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:74)
at org.apache.lucene.search.Hits.<init>(Hits.java:61)
at org.apache.lucene.search.Searcher.search(Searcher.java:55)
at net.jforum.search.LuceneSearch.performSearch(LuceneSearch.java:152)
at net.jforum.search.LuceneSearch.search(LuceneSearch.java:108)
at net.jforum.search.LuceneManager.search(LuceneManager.java:139)
at net.jforum.search.SearchFacade.search(SearchFacade.java:105)
at net.jforum.search.ContentSearchOperation.performSearch(ContentSearchOperation.java:65)
at net.jforum.view.forum.SearchAction.search(SearchAction.java:103)
at net.jforum.view.forum.SearchAction.search(SearchAction.java:93)
... 23 more
Caused by: java.lang.RuntimeException: no terms in field post.id - cannot determine sort type
... 43 more


Have anyone had thi problem? I have a fix for this but I am not sure if the solution is correct - in class LuceneSearch.java in line 174 I specified the sort type

sort = new Sort(new SortField("post.id", SortField.STRING, "DESC".equals(args.getOrderDir())));

and it works, but I think there must be better solution, I am not completely sure what's going on here - maybe some improper indexing approach, or other problem related to improper database structure or setting?

Thanks.
Roman
[originally posted on jforum.net by romant]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok,
I think I have found a clue - the problem is that the lucene index file is not probably generated - maybe it can be caused by the fact that I deploy jforum.war file a couple of times in a day. And if the information whether the index file is generated or not is stored in the jforum database it could cause the problem. But I would expect that the mechanism is smarter - is anybody able to tell me how this works?

Thanks.
Roman
[originally posted on jforum.net by romant]
 
It's never done THAT before. Explain it to me tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic