1

Lets say I have indexes as such: 1. Black Lilly Knitted Shirt 2. Black Knitted Shirt 3. Black Knitted Jeans

I want to run a search term "black knitted shirt" and return 1. and 2.

Meaning, only indexes containing search keywords are returned. How do I query Lucene to get such results?

Evaldas Raisutis
  • 1,628
  • 4
  • 18
  • 32

1 Answers1

0

Either

  • black AND knitted AND shirt
  • "black knitted shirt"~1

The first means match where the field MUST contain each term.

The second is a slop phrase. The 1 means one "operation" can be performed in order to match. See other slop answer for some more info.

Community
  • 1
  • 1
AndyPook
  • 2,762
  • 20
  • 23