Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.1
    • Component/s: general/javadocs
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      Just needs to be committed to 2.9 branch since hits is now removed.

        Activity

        Hide
        Mark Miller added a comment -

        Here is what I have so far (taken from an email i sent to the dev list):

         * @deprecated
         * see {@link Searcher#search(Query, int)}, {@link Searcher#search(Query, Filter, int)}
         * and {@link Searcher#search(Query, Filter, int, Sort)}:<br>
         * <pre>
         *   TopDocs topDocs = searcher.search(query, numHits);
         *   ScoreDoc[] hits = topDocs.scoreDocs;
         *   for (int i = 0; i < hits.length; i++) {
         *     int docId = hits[i].doc;
         *     Document d = searcher.doc(docId);
         *     // do something with current hit
         *     ...
         * </pre>
         */
        
        Show
        Mark Miller added a comment - Here is what I have so far (taken from an email i sent to the dev list): * @deprecated * see {@link Searcher#search(Query, int )}, {@link Searcher#search(Query, Filter, int )} * and {@link Searcher#search(Query, Filter, int , Sort)}:<br> * <pre> * TopDocs topDocs = searcher.search(query, numHits); * ScoreDoc[] hits = topDocs.scoreDocs; * for ( int i = 0; i < hits.length; i++) { * int docId = hits[i].doc; * Document d = searcher.doc(docId); * // do something with current hit * ... * </pre> */
        Hide
        Mark Miller added a comment -

        Mike fixed as:

         * @deprecated
         * see {@link TopScoreDocCollector} and {@link TopDocs} :<br>
         * <pre>
         *   TopScoreDocCollector collector = TopScoreDocCollector.create(hitsPerPage, false);
         *   searcher.search(new TermQuery(new Term("field", "iterator")), collector);
         *   ScoreDoc[] docHits = collector.topDocs().scoreDocs;
         *   for (int i = 0; i < docHits.length; i++) {
         *     int docId = docHits[i].doc;
         *     Document d = searcher.doc(docId);
         *   }
         * </pre>
        

        But as we discussed in the past, I think we want to point people to Searcher.search instead?

        Show
        Mark Miller added a comment - Mike fixed as: * @deprecated * see {@link TopScoreDocCollector} and {@link TopDocs} :<br> * <pre> * TopScoreDocCollector collector = TopScoreDocCollector.create(hitsPerPage, false ); * searcher.search( new TermQuery( new Term( "field" , "iterator" )), collector); * ScoreDoc[] docHits = collector.topDocs().scoreDocs; * for ( int i = 0; i < docHits.length; i++) { * int docId = docHits[i].doc; * Document d = searcher.doc(docId); * } * </pre> But as we discussed in the past, I think we want to point people to Searcher.search instead?
        Hide
        Michael McCandless added a comment -

        I think we want to point people to Searcher.search instead?

        Woops sorry I missed this, and, I agree. And your fix looks good to me. Wanna commit that on 2.9.1?

        Show
        Michael McCandless added a comment - I think we want to point people to Searcher.search instead? Woops sorry I missed this, and, I agree. And your fix looks good to me. Wanna commit that on 2.9.1?
        Hide
        Michael McCandless added a comment -

        Mark do you want to commit this? Or I can. Wanting to cut an RC tomorrow...

        Show
        Michael McCandless added a comment - Mark do you want to commit this? Or I can. Wanting to cut an RC tomorrow...
        Hide
        Mark Miller added a comment -

        Sorry again I'm slowing everything up - feel free - if you don't, I'll do it when I commit the Highlighter fix in a bit. Just have to throw my noisy laptop out the window and into a brick wall first ...

        Show
        Mark Miller added a comment - Sorry again I'm slowing everything up - feel free - if you don't, I'll do it when I commit the Highlighter fix in a bit. Just have to throw my noisy laptop out the window and into a brick wall first ...
        Hide
        Michael McCandless added a comment -

        Bulk close all 2.9.1 issues.

        Show
        Michael McCandless added a comment - Bulk close all 2.9.1 issues.

          People

          • Assignee:
            Mark Miller
            Reporter:
            Mark Miller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development