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 8544427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:33:18+00:00 2026-06-11T12:33:18+00:00

I am working with apache-solr-3.6.0 on windows machine. I would like to search for

  • 0

I am working with apache-solr-3.6.0 on windows machine. I would like to search for two words with certain number of words apart (No more than this number).
For example:
Consider the following phrases, I would like to search for Daisy & exam with no more than 2 words apart.

Daisy has exam.
Daisy has an exam.
Daisy has a math exam.
Daisy has a difficult math exam.

I searched for such thing and I tried Term Proximity.

http://localhost:8983/solr/select/?q="Daisy exam"~2&version=2.2&start=0&rows=10&indent=on&debugQuery=true

The result that I need should be the phrase: Daisy has an exam. But using the above criteria, the result was the last 3 phrase.

So any ideas to use an exact number of words apart?

  • 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-06-11T12:33:20+00:00Added an answer on June 11, 2026 at 12:33 pm

    Check out the related question here:
    Solr proximity ordered vs unordered

    When you say ‘no more than 2 words apart’, then you should have both first and second phrase matched. Then your query would be "Daisy exam"~1, which will match Daisy exam and an insertion between them (which is one change: changes exam position from 2 to 3).

    In order to prevent “Daisy exam” from the matched result, you can add -"Daisy exam" to your query. Alternatively you may add fq=-"Daisy exam" to your query string params.

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

Sidebar

Related Questions

I've been working with the Apache Mahout machine learning libaries in my free time
I am working on Solr in my application. I am using apache-solr-solrj-1.4.0.jar . When
I'm configuring my solr for two cores and have got most of it working,
Hi I was working with apache fop and when the number of pages exceeds
I'm working on Windows with Apache and PHP. I just installed MySQL, configured it,
I'm working with Apache FOP v.1.0 (latest) on Windows XP and I want to
I have installed Apache Solr with Tomcat and my /solr/admin is working fine. But
I've been struggling to get Mercurial working with Apache on Windows XP. I've read
Hi I have copied my Solr config from a working windows server to a
I'm working on an Apache Wicket project in Eclipse with Maven2 -- my SCM

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.