Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6812395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:26:37+00:00 2026-05-26T20:26:37+00:00

By ordered I mean term1 will always come before term2 in the document. I

  • 0

By ordered I mean term1 will always come before term2 in the document.

I have two documents:
1. “By ordered I mean term1 will always come before term2 in the document”
2. “By ordered I mean term2 will always come before term1 in the document”

if I make the query:

"term1 term2"~Integer.MAX_VALUE

my results is: 2 documents

How can I query to have one result (only if term1 come before term2):
“By ordered I mean term1 will always come before term2 in the document”

Any Ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:26:38+00:00Added an answer on May 26, 2026 at 8:26 pm

    You would need to use SpanNearQuery
    This Matches spans which are near one another. One can specify slop, the maximum number of intervening unmatched positions, as well as whether matches are required to be in-order.

    However, the dismax and edismax query parsers with Solr uses the phrase query and hence the match is always unordered.

    SurroundQueryParser supports the Span queries with an option to make a query for both ordered and unordered terms with a slight change in the syntax.
    Although this Query Parser is available with the trunk only.

    More info @ http://www.lucidimagination.com/blog/2009/02/22/exploring-query-parsers/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

another ordered delivery problem. We have an orchestration which is bound to a send
I have multiple ordered lists. Unfortunately, the order of the items isn't a simple
I have an ordered list in HTML. I would like to add styling only
I have an ordered list (ol) on my page but the numbering is not
I wanna place two child un-ordered lists side by side. They are having Class
An HTTP GET query string is a ordered sequence of key/value pairs: ?spam=eggs&spam=ham&foo=bar Is,
can I use definition lists just like unordered/ordered lists? I mean insert DIVs any
Say I have a set of Strings that I want to be ordered by
I hi have just ordered a couple of beaglboards for experimenting. I know that
If A has the Ordered[A] trait, I'd like to be able to have code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.