Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-514

MultiPhraseQuery should allow access to terms

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: None
    • Component/s: core/search
    • Labels:
      None

      Activity

      Hide
      lucenebugs@danielnaber.de Daniel Naber added a comment -

      Actually that patch makes the list itself immutable, but not the arrays inside. I think what is needed is something like this:

      public List getTerms() {
      List nestedList = new ArrayList();
      for (Iterator iter = termArrays.iterator(); iter.hasNext()

      { Term[] terms = (Term[]) iter.next(); nestedList.add(Arrays.asList(terms)); }

      return Collections.unmodifiableList(nestedList);
      }

      Show
      lucenebugs@danielnaber.de Daniel Naber added a comment - Actually that patch makes the list itself immutable, but not the arrays inside. I think what is needed is something like this: public List getTerms() { List nestedList = new ArrayList(); for (Iterator iter = termArrays.iterator(); iter.hasNext() { Term[] terms = (Term[]) iter.next(); nestedList.add(Arrays.asList(terms)); } return Collections.unmodifiableList(nestedList); }
      Hide
      yseeley@gmail.com Yonik Seeley added a comment -

      Thanks Eric, I renamed the method to be more descriptive (since we aren't using Java5),
      threw in an implementation of extractTerms() , and committed this.

      Show
      yseeley@gmail.com Yonik Seeley added a comment - Thanks Eric, I renamed the method to be more descriptive (since we aren't using Java5), threw in an implementation of extractTerms() , and committed this.

        People

        • Assignee:
          yseeley@gmail.com Yonik Seeley
          Reporter:
          ejain Eric Jain
        • Votes:
          1 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development