I am working on an ecommerce project in which we are using Solr search engine. If I search for "Apache Lucene" with SPACE, it gives the search results for "Apache Lucene" or "Apache" or "Lucene" but i only want "Apache Lucene" .So, here I am looking for EXACT MATCH of MULTIPLE WORDS that includes WHite SPACES.Can somebody please suggest me any solution?
Asked
Active
Viewed 76 times
0
-
Can you please use `"` to make your question clearer. I am having trouble what you mean – Jose Llausas Jun 10 '16 at 16:50
-
Possible duplicate of [solr query with white space](http://stackoverflow.com/questions/5790180/solr-query-with-white-space) – tkja Jun 10 '16 at 18:36
-
@tkja hey hie. I already went through that link but didn't help me out. Do you know something else? – Vaidehi Jariwala Jun 10 '16 at 18:52
-
Do you want to include documents that have "Apache Solr Lucene" or "Lucene from Apache" etc.? – MatsLindh Jun 10 '16 at 19:01
-
@MatsLindh I just want to include documents that has both "Apache Lucene". The problem I am facing is when i search for "Apache Lucene", solr is not taking both the words together because of whitespace and so I get the following results- documents having "Apache", "Lucene" or "Apache Lucene" .So I need solve the problem of white space so that i can retrieve documents that have both "Apache Lucene" – Vaidehi Jariwala Jun 10 '16 at 19:54
-
1Yes, my question was whether they have to be placed after each other in the correct sequence, or if they can be anywhere within the text. The first would be a phrase query (which should work with `field:"apache lucene"`), the latter is either `mm=100%` (or a different `mm` setting if you want a different match profile) or `q.op=AND` (both with (e)dismax). – MatsLindh Jun 10 '16 at 21:46
-
@Enigmativity Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. As per [link](http://stackoverflow.com/help/on-topic) it states `software tools commonly used by programmers`. This is question relation to Solr under [solr]. It's cool – darthsidious Jun 14 '16 at 13:35
-
@darthsidious - You missed half of the quote - it states `"software tools commonly used by programmers; and is a practical, answerable problem that is unique to software development"`. Simply being a tool used by programmers is not enough - the question must be about software development too. – Enigmativity Jun 14 '16 at 13:51
1 Answers
0
As @MatsLindh pointed out. You can use the Dismax or the eDisMax querying capability instead of the Standard Query for phrased queries. You have to set mm=100%
for DisMax or q.op=AND
.

darthsidious
- 2,851
- 3
- 19
- 30