Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14396

TaggerRequestHandler Should Not Error on Empty Collection

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 8.6
    • None
    • None

    Description

      The TaggerRequestHandler (added in SOLR-12376) currently returns a 400 (Bad Request) if used on a collection with no terms in the index. This probably made sense for the use cases for which it was originally written (in the OpenSextant project, before it was contributed to Solr) that focused on on stand-alone document tagging, where the calling application expected there to always be an index.

      More and more use cases are emerging for using the TaggerRequestHandler in real-time for user queries, however. For example, real-time phrase matching and entity resolution in queries. In these cases, the data in the tagger collection may be dynamically updated, and at times, the collection may even be empty.

      While it's certainly possible for the 400 error to be handled client-side for empty collections, the incoming requests aren't really "bad" requests in my opinion, the index just doesn't have any data yet. Sending the same request subsequently once some documents are indexed would result in a success.

      I'm proposing we remove the exception for empty indexes and simply return no matched tags instead.

      If it's important for anyone to preserve the current behavior, we could add a parameter "errorOnEmptyCollection". Does anyone think preserving the error here is needed? What say you dsmiley?

      Attachments

        Issue Links

          Activity

            People

              dsmiley David Smiley
              solrtrey Trey Grainger
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m