java.lang.RuntimeException: no terms in field workratio

Atlassian JIRA | Andreas Knecht | 10 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Sorting by work-ratio doesn't work, if no issues have an original estimate set. The outcome for a user is that if you try to sort, you'll get a RuntimeException in your browser: {noformat} java.lang.RuntimeException: no terms in field workratio at com.atlassian.jira.issue.search.parameters.lucene.sort.JiraLuceneFieldCache.getCustom(JiraLuceneFieldCache.java:36) at com.atlassian.jira.issue.search.parameters.lucene.sort.MappedSortComparator.getComparatorUsingTerms(MappedSortComparator.java:40) at com.atlassian.jira.issue.search.parameters.lucene.sort.MappedSortComparator.newComparator(MappedSortComparator.java:34) at org.apache.lucene.search.FieldSortedHitQueue.getCachedComparator(FieldSortedHitQueue.java:197) at org.apache.lucene.search.FieldSortedHitQueue.<init>(FieldSortedHitQueue.java:58) at org.apache.lucene.search.TopFieldDocCollector.<init>(TopFieldDocCollector.java:44) at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:108) at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:65) at org.apache.lucene.search.Hits.<init>(Hits.java:52) at org.apache.lucene.search.Searcher.search(Searcher.java:62) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.runSearch(LuceneSearchProvider.java:136) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.getHits(LuceneSearchProvider.java:68) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:195) at com.atlassian.jira.web.action.issue.IssueNavigator.getSearchResults(IssueNavigator.java:355) at com.atlassian.jira.web.action.issue.IssueNavigator.getBrowsableItems(IssueNavigator.java:326) at com.atlassian.jira.web.action.issue.IssueNavigator.doExecute(IssueNavigator.java:203) at webwork.action.ActionSupport.execute(ActionSupport.java:153) at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:54) at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:132) at com.atlassian.jira.web.dispatcher.JiraServletDispatcher.service(JiraServletDispatcher.java:209) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) ... {noformat} The reason for this is that the WorkRatioIndexer does not index anything if the original estimate is null: {code} // Add actual vs estimated work ratio to index for range query - only add work ratio if a time estimate for issue exists if (issue.getOriginalEstimate() != null) { doc.add(Field.Keyword(DocumentConstants.ISSUE_WORKRATIO, WorkRatio.getPaddedWorkRatio(issue.getGenericValue()))); } {code} Our sorting code (the JiraLuceneFieldCache) in particular can't handle the case where there's no terms for a field yet: {code} if (termEnum.term() == null) { throw new RuntimeException("no terms in field " + field); } {code} We need to fix either the sorting, or indexing. (Sorting's probably the safer way to go about it in the long run.)

    Atlassian JIRA | 10 years ago | Andreas Knecht
    java.lang.RuntimeException: no terms in field workratio
  2. 0

    Sorting by work-ratio doesn't work, if no issues have an original estimate set. The outcome for a user is that if you try to sort, you'll get a RuntimeException in your browser: {noformat} java.lang.RuntimeException: no terms in field workratio at com.atlassian.jira.issue.search.parameters.lucene.sort.JiraLuceneFieldCache.getCustom(JiraLuceneFieldCache.java:36) at com.atlassian.jira.issue.search.parameters.lucene.sort.MappedSortComparator.getComparatorUsingTerms(MappedSortComparator.java:40) at com.atlassian.jira.issue.search.parameters.lucene.sort.MappedSortComparator.newComparator(MappedSortComparator.java:34) at org.apache.lucene.search.FieldSortedHitQueue.getCachedComparator(FieldSortedHitQueue.java:197) at org.apache.lucene.search.FieldSortedHitQueue.<init>(FieldSortedHitQueue.java:58) at org.apache.lucene.search.TopFieldDocCollector.<init>(TopFieldDocCollector.java:44) at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:108) at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:65) at org.apache.lucene.search.Hits.<init>(Hits.java:52) at org.apache.lucene.search.Searcher.search(Searcher.java:62) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.runSearch(LuceneSearchProvider.java:136) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.getHits(LuceneSearchProvider.java:68) at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:195) at com.atlassian.jira.web.action.issue.IssueNavigator.getSearchResults(IssueNavigator.java:355) at com.atlassian.jira.web.action.issue.IssueNavigator.getBrowsableItems(IssueNavigator.java:326) at com.atlassian.jira.web.action.issue.IssueNavigator.doExecute(IssueNavigator.java:203) at webwork.action.ActionSupport.execute(ActionSupport.java:153) at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:54) at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:132) at com.atlassian.jira.web.dispatcher.JiraServletDispatcher.service(JiraServletDispatcher.java:209) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) ... {noformat} The reason for this is that the WorkRatioIndexer does not index anything if the original estimate is null: {code} // Add actual vs estimated work ratio to index for range query - only add work ratio if a time estimate for issue exists if (issue.getOriginalEstimate() != null) { doc.add(Field.Keyword(DocumentConstants.ISSUE_WORKRATIO, WorkRatio.getPaddedWorkRatio(issue.getGenericValue()))); } {code} Our sorting code (the JiraLuceneFieldCache) in particular can't handle the case where there's no terms for a field yet: {code} if (termEnum.term() == null) { throw new RuntimeException("no terms in field " + field); } {code} We need to fix either the sorting, or indexing. (Sorting's probably the safer way to go about it in the long run.)

    Atlassian JIRA | 10 years ago | Andreas Knecht
    java.lang.RuntimeException: no terms in field workratio

    Root Cause Analysis

    1. java.lang.RuntimeException

      no terms in field workratio

      at com.atlassian.jira.issue.search.parameters.lucene.sort.JiraLuceneFieldCache.getCustom()
    2. com.atlassian.jira
      MappedSortComparator.newComparator
      1. com.atlassian.jira.issue.search.parameters.lucene.sort.JiraLuceneFieldCache.getCustom(JiraLuceneFieldCache.java:36)
      2. com.atlassian.jira.issue.search.parameters.lucene.sort.MappedSortComparator.getComparatorUsingTerms(MappedSortComparator.java:40)
      3. com.atlassian.jira.issue.search.parameters.lucene.sort.MappedSortComparator.newComparator(MappedSortComparator.java:34)
      3 frames
    3. Lucene
      Searcher.search
      1. org.apache.lucene.search.FieldSortedHitQueue.getCachedComparator(FieldSortedHitQueue.java:197)
      2. org.apache.lucene.search.FieldSortedHitQueue.<init>(FieldSortedHitQueue.java:58)
      3. org.apache.lucene.search.TopFieldDocCollector.<init>(TopFieldDocCollector.java:44)
      4. org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:108)
      5. org.apache.lucene.search.Hits.getMoreDocs(Hits.java:65)
      6. org.apache.lucene.search.Hits.<init>(Hits.java:52)
      7. org.apache.lucene.search.Searcher.search(Searcher.java:62)
      7 frames
    4. com.atlassian.jira
      IssueNavigator.doExecute
      1. com.atlassian.jira.issue.search.providers.LuceneSearchProvider.runSearch(LuceneSearchProvider.java:136)
      2. com.atlassian.jira.issue.search.providers.LuceneSearchProvider.getHits(LuceneSearchProvider.java:68)
      3. com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:195)
      4. com.atlassian.jira.web.action.issue.IssueNavigator.getSearchResults(IssueNavigator.java:355)
      5. com.atlassian.jira.web.action.issue.IssueNavigator.getBrowsableItems(IssueNavigator.java:326)
      6. com.atlassian.jira.web.action.issue.IssueNavigator.doExecute(IssueNavigator.java:203)
      6 frames
    5. webwork.action
      ActionSupport.execute
      1. webwork.action.ActionSupport.execute(ActionSupport.java:153)
      1 frame
    6. com.atlassian.jira
      JiraActionSupport.execute
      1. com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:54)
      1 frame
    7. webwork.dispatcher
      GenericDispatcher.executeAction
      1. webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:132)
      1 frame
    8. com.atlassian.jira
      JiraServletDispatcher.service
      1. com.atlassian.jira.web.dispatcher.JiraServletDispatcher.service(JiraServletDispatcher.java:209)
      1 frame
    9. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      1 frame
    10. Atmosphere weblogic
      TailFilter.doFilter
      1. weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072)
      2. weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)
      3. weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
      3 frames