Solr
  1. Solr
  2. SOLR-3955

Return only matched multiValued field

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0
    • Fix Version/s: None
    • Component/s: search
    • Labels:

      Description

      Assuming a multivalued, stored and indexed field named "comment". When performing a search, it would be very helpful if there were a way to return only the values of "comment" which contain the match. For example:

      When searching for "gold" instead of getting this result:

      <doc>
      <arr name="comment">
      <str>Theres a lady whos sure</str>
      <str>all that glitters is gold</str>
      <str>and shes buying a stairway to heaven</str>
      </arr>
      </doc>

      I would prefer to get this result:

      <doc>
      <arr name="comment">
      <str>all that glitters is gold</str>
      </arr>
      </doc>

      (psuedo-XML from memory, may not be accurate but illustrates the point)

      Thanks.

        Activity

        Dotan Cohen created issue -
        Hide
        Sandeep Tucknat added a comment - - edited

        This is especially important in a spatial search since there's an important business case of finding the branches/locations for an entity within a spatial filtering query. While the multi-valued spatial field implementation provides for filtering and scoring, it does not return this information to the client at the moment.

        PS : I am relatively new to Solr and SE in general but have years of Java coding and debugging experience. I'd love to help resolve this if someone can point me in the right direction and something more than 'hook it up to the debugger and start looking' would be appreciated.

        Show
        Sandeep Tucknat added a comment - - edited This is especially important in a spatial search since there's an important business case of finding the branches/locations for an entity within a spatial filtering query. While the multi-valued spatial field implementation provides for filtering and scoring, it does not return this information to the client at the moment. PS : I am relatively new to Solr and SE in general but have years of Java coding and debugging experience. I'd love to help resolve this if someone can point me in the right direction and something more than 'hook it up to the debugger and start looking' would be appreciated.
        Hide
        Jeff Geerling added a comment -

        To echo Sandeep's comment above; this would be a very useful feature for multivalued geospatial search; currently, with geo search, you can have dist returned in your search results (so you can give km/mi distance to a user), but not a latitude/longitude pair, or any other specific information.

        Currently, the workaround is to take each returned result and calculate all address distances in our application code, then display the address that is nearest to the original lat lon value.

        Show
        Jeff Geerling added a comment - To echo Sandeep's comment above; this would be a very useful feature for multivalued geospatial search; currently, with geo search, you can have dist returned in your search results (so you can give km/mi distance to a user), but not a latitude/longitude pair, or any other specific information. Currently, the workaround is to take each returned result and calculate all address distances in our application code, then display the address that is nearest to the original lat lon value.
        Hide
        David Smiley added a comment -

        I could imagine a new SearchComponent similar to the highlighter (specifically the default highlighter) what would create a MemoryIndex for each value and test the search to see if it matched. Though it would be faster if there were specific optimizations for certain queries like spatial in which doing that is way more work than a simple shape intersection test. I guess that would be best done as a separate specialized SearchComponent.

        Show
        David Smiley added a comment - I could imagine a new SearchComponent similar to the highlighter (specifically the default highlighter) what would create a MemoryIndex for each value and test the search to see if it matched. Though it would be faster if there were specific optimizations for certain queries like spatial in which doing that is way more work than a simple shape intersection test. I guess that would be best done as a separate specialized SearchComponent.
        Hide
        Jacob Xu added a comment -

        This is a urgent issue that should be concerned. Specially, when the multiValued filed has large number of values (>1K), it will cost high memory and I/O to return all values.

        Show
        Jacob Xu added a comment - This is a urgent issue that should be concerned. Specially, when the multiValued filed has large number of values (>1K), it will cost high memory and I/O to return all values.

          People

          • Assignee:
            Unassigned
            Reporter:
            Dotan Cohen
          • Votes:
            5 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

            • Created:
              Updated:

              Development