Solr
  1. Solr
  2. SOLR-1980

Implement boundary match support

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Sometimes you need to specify that a query should match only at the start or end of a field, or be an exact match.

      We should have a query syntax for boundary match, preferably on a lowest possible level such as the "lucene" query parser.

        Activity

        Jan Høydahl created issue -
        Jan Høydahl made changes -
        Field Original Value New Value
        Fix Version/s 4.0 [ 12314992 ]
        Jan Høydahl made changes -
        Description Sometimes you need to specify that a query should match only at the start or end of a field, or be an exact match.

        Example content:
        1) a quick fox is brown
        2) quick fox is brown

        Example queries:
        "^quick fox" -> should only match 2)
        "brown$" -> should match 1) and 2)
        "^quick fox is brown$" -> should only match 2)

        Proposed way of implmementation is through a new BoundaryMatchTokenFilter which behaves like this:
        On the index side it inserts special unique tokens at beginning and end of field. These could be some weird unicode sequence.
        On the query side, it looks for the first character matching "^" or the last character matching "$" and replaces them with the special tokens.
        Sometimes you need to specify that a query should match only at the start or end of a field, or be an exact match.

        We should have a query syntax for boundary match, preferably on a lowest possible level such as the "lucene" query parser.
        Component/s query parsers [ 12317802 ]
        Hoss Man made changes -
        Fix Version/s 4.0 [ 12322455 ]
        Fix Version/s 4.0-ALPHA [ 12314992 ]
        Robert Muir made changes -
        Fix Version/s 4.0 [ 12322551 ]
        Fix Version/s 4.0-BETA [ 12322455 ]
        Hoss Man made changes -
        Fix Version/s 4.0 [ 12322551 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Jan Høydahl
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development