Whole phrase search possible in solr for double quotes - solr

I want to do a phrase search in solr without analyzers being applied to it
eg - If I search for "DelhiDareDevil" (i.e - with inverted commas)it should search the exact text and not apply any analyzers or tokenizers on this field
However if i search for DelhiDareDevil it should use tokenizers and analyzers and split it to something like this delhi dare devil
any help would be appreciated

Not sure of any Out of the Box approach, you can copy field the content to a new field with no analysis.
And, You can define your own query parser and have the query being searched on the field with no analysis.

Related

All query highlight in apache solr

As I am trying to do highlighting in apache solar. I see it highlights even single words in lines. I want to highlight if all query matches. how can i set parameters for that?
I do not want to highlight single words in a query. Highlight only if all query matches in a line.
query - What is synchronization and why is it important
result
1) What is <em>synchronization</em> and why is it <em>important</em>?
2) What is typically the MOST <em>important</em> reason to use risk to drive testing efforts?
iIdon't want to highlight queries with single word match i want to highlight only those with exact match. so how can I configure highlight in solar.
and is there another way i can get field name for matched text.
Simple answer: All you need to know about configuring the Solr highlighter are in the Wiki.
Long answer: You should configure the hl.usePhraseHighlighter Parameter to true. Solr will highlight phrase queries accurately as phrases. Normally, the parts of the phrase will be highlighted everywhere instead of only when it forms the given phrase.

Manipulating and Removing Facets in Apache Solr

I am creating a front end application which queries through a database using the Apache Solr engine, but I have two issues that I just cannot find the answer to.
When Solr is processing a Facet query, how do I get the facet to be a single phrase ("Department of the Navy (160)") instead of a broken up facet of 4 terms ("Department (160)" "of (200)" "the (200)" "Navy(160)").
Also, how do I remove certain facets from being queried, for example "and" "to" "the" etc.
Thank you.
Looks like your phrase is being indexed into a Text field which, among many things, splits by whitespace. This is very good for full text search but not for faceting.
You can have a duplicate field for this, of type string (and not Text), which is not splitted. You can still use the original field for searching but the new string field for faceting.

Difference between NGramFilterFactory and EdgeNGramFilterFactory

I am a beginner in Solr. In my project, NGramFilterFactory and EdgeNGramFilterFactory, both are being used for a field. My understanding as per the document is EdgeNGramFilterFactory is used for "starts with" query while NGramFilterFactory is suitable for "contains" query.
I indexed a small dataset for both combinations (one in which I used only NGramFilterFactory and in another I used both NGramFilterFactory and EdgeNGramFilterFactory) but I did not see any difference in the output.
If my understanding is correct, in a way EdgeNGramFilterFactory is a subset of NGramFilterFactory. If this is true then is there any benefit of using both types of filters on the same field?
You should not be using both filters on the same field, they will completely mess up your matching. If you need to match in a middle of a token, you use NGrams. If you only need to match from the start, you use EdgeNGrams. Never both together.

prevent solr phrase query from being stemmed or stripped of stopwords

I'm trying to check if this feature is even possible to implement with Solr.
I have a text field defined and on the query analyzer I've defined among others a StopFilterFactory and a PorterStemFilterFactory.
I use edsimax as the request handler.
under my current implementation, if i search for:
q = "this is a phrasing query" this is not phrasing
the lucene query will be: (excuse me for the pseudo syntax )
text:"this ? ? phras query" | text: this | text:phras
where what i would like to get is:
text:"this is a phrasing query" | text: this | text:phras
In other words i would like to set the behavior of wrapping a phrase with quotes to be:
a document will only match if the entire phrase without any tokenizing will appear in it.
I understand it maybe possible by defining an additional field which will not undergo any processing and increasing it's boost on the edismax configuration.
but this will return matches for documents which don't include the exact phrase.
Can this be implemented on Solr?
How?
How about matching different parts of the query against separate fields? Either through a fq to filter against text_exact or through regular search syntax for scoring as well: text_exact:"this is a phrasing query" this is not phrasing where the last terms should be searched against the default search field or qf iirc.

Solr/Lucene - partial fuzzy match

How do you set up partial (substring) fuzzy match in Solr 4.2.1?
For example, if you have a list of US cities indexed, I would like a search term "Alber" to match "Alburquerque".
I have tried using the NGramFilterFactory on the <fieldType> and rebuilt the index but queries do not return results as expected - they still work as if I had just done the standard text_general defaults. Exact matches work, and explicit fuzzy searches would work given sufficient similarity (for example "Alberquerque~" with one misspelling would work.)
I did go to the analyzer tool in the Solr admin and saw that my ngrams were indeed being generated.
Is there something i'm missing from the query side?
Or should I take a different approach altogether?
And can this work with dismax? (Multiple fields indexed like this with different weights)
Thanks!

Resources