Thank you!! Okay, I think I have that all squared away.
*SpanLastQuery*: I need something like SpanFirstQuery, except that it would be SpanLastQuery. Is there a way to get that to work? *Proximity weighting getting ignored*: I also need to get span term boosting working. Here's my query: "one thousand two hundred thirty" pre/5 (seven:5.32 or three:3 or two:2.9) Here's the resulting Solr query: spanNear([spanNear([field:one, field:thousand, field:two, field:hundred, field:thirty], 0, true), spanOr([spanOr([(field:seven)^5.32, (field:three)^3.0]), (field:two)^2.9])], 5, true) It's returning [1232, 1233, 1237] Expected: [1237, 1233, 1232] Here's what the scoreDocs has to say about this search's results: [doc=1232 score=5.903808 shardIndex=0, doc=1233 score=5.903808 shardIndex=0, doc=1237 score=5.903808 shardIndex=0] Notice that the scores were all the exact same. Why don't the boosts appear to be working? Thank you! On Tue, Jun 21, 2016 at 1:40 PM, Allison, Timothy B. <talli...@mitre.org> wrote: > >Awesome, 0 pre and 1 post works! > > Great! > > > What if I wanted to match thirty, but exclude if six or seven are > included anywhere in the document? > > Any time you need "anywhere in the document", use a "regular" query (not > SpanQuery). As you wrote initially, you can construct a BooleanQuery that > includes a complex SpanQuery and another Query that is > BooleanClause.Occur.MUST_NOT. > > > I also tried 0 pre and 0 post > You'd use those if you wanted to find something that didn't contain > something else: > > ["William Clinton"~2 Jefferson]!~0,0 > > Find 'william' within two words of 'clinton', but not if 'jefferson' > appears between them. > > > I replaced pre with Integer.MAX_VALUE and post with Integer.MAX_VALUE - > 5 and it works! > I'll have to think about this one... > >