Solr
  1. Solr
  2. SOLR-949

Add QueryResponse and SolrQuery support for TermVectorComponent

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: clients - java
    • Labels:
      None

      Description

      In a similar fashion to Facet information, it would be nice to have support for easily setting TermVector related parameters through SolrQuery, and it would be nice to have methods in QueryResponse to easily retrieve TermVector information

      1. SOLR-949.patch
        26 kB
        Łukasz Dróżdż
      2. SOLR-949.patch
        85 kB
        Aleksander M. Stensby

        Activity

        Hide
        Aleksander M. Stensby added a comment -

        This patch includes support for specifying what term vector information we want to retrieve (tf, df, tf_idf, positions, offsets, all) and specifying term vector fields. A new class called TermVectorInfo is added, containing the returned TermVector information (returned in QueryResponse). (Not really sure if this is a good name, so feel free to change or give feedback.) The patch also includes a test in SolrQuery for setting/getting parameters, and a test in SolrExampleTests for testing the SolrResponse. One note: I intended to use TermVectorComponent.COMPONENT_NAME in SolrQuery, but ant would not compile because it complained about not being able to find the package:
        package org.apache.solr.handler.component does not exist
        So temporarily until i figure out why this happens i use "tv" for now.. Sorry about that.
        I hope my code makes sense and that it might be useful for others.

        Show
        Aleksander M. Stensby added a comment - This patch includes support for specifying what term vector information we want to retrieve (tf, df, tf_idf, positions, offsets, all) and specifying term vector fields. A new class called TermVectorInfo is added, containing the returned TermVector information (returned in QueryResponse). (Not really sure if this is a good name, so feel free to change or give feedback.) The patch also includes a test in SolrQuery for setting/getting parameters, and a test in SolrExampleTests for testing the SolrResponse. One note: I intended to use TermVectorComponent.COMPONENT_NAME in SolrQuery, but ant would not compile because it complained about not being able to find the package: package org.apache.solr.handler.component does not exist So temporarily until i figure out why this happens i use "tv" for now.. Sorry about that. I hope my code makes sense and that it might be useful for others.
        Hide
        Shalin Shekhar Mangar added a comment -

        One note: I intended to use TermVectorComponent.COMPONENT_NAME in SolrQuery, but ant would not compile because it complained about not being able to find the package: package org.apache.solr.handler.component does not exist

        The Solrj client is compiled separately from the core solr source to avoid any dependency to the (large) core jar. The package you wanted to use is not in solrj's compile classpath.

        Show
        Shalin Shekhar Mangar added a comment - One note: I intended to use TermVectorComponent.COMPONENT_NAME in SolrQuery, but ant would not compile because it complained about not being able to find the package: package org.apache.solr.handler.component does not exist The Solrj client is compiled separately from the core solr source to avoid any dependency to the (large) core jar. The package you wanted to use is not in solrj's compile classpath.
        Hide
        David Smiley added a comment -

        It would be easier for a committer to digest this patch if you didn't do any reformatting of existing code.

        Show
        David Smiley added a comment - It would be easier for a committer to digest this patch if you didn't do any reformatting of existing code.
        Hide
        Łukasz Dróżdż added a comment - - edited

        I've attached Aleksander's patch with fixed formatting and adapted to compile and test against latest trunk (rev. 1687524).

        Show
        Łukasz Dróżdż added a comment - - edited I've attached Aleksander's patch with fixed formatting and adapted to compile and test against latest trunk (rev. 1687524).

          People

          • Assignee:
            Unassigned
            Reporter:
            Aleksander M. Stensby
          • Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:

              Development