Change SOLR Default Conjunction - search

I'm using an app that has SOLR embedded.
SOLR is running as a war in the webapps area of Tomcat.
Is there a SOLR configuration that allows me to switch the default SOLR behavior for searches to assume 'AND' instead of 'OR' as the conjunctive operator?

Add (or modify h/t #Madbreaks ) this line in your schema file (usually schema.xml)
<solrQueryParser defaultOperator="AND"/>

Related

Case insensitive search in Crafer CMS with elasticsearch?

I wanted to implement auto-completion with type head, following this documentation, I was able to achieve that. But the search was case sensitive.
Following this documentation, it says, to enable case insensitive search I should select Tokenize for indexing option, this way.
I am using crafter CMS 3.1.0 version and I don't use any Tokenize for indexing option;
Note: The version used in documentation is 3.1.9, is this feature not available in 3.1.0?
the feature should work in 3.1.0 too. Keep in mind that after you enable the "Tokenize for indexing" option you will need to reindex all existing content and change your query to use the new field with the _t postfix.

Drupal 8 search api solr want to get all items

i´m using drupal8 with solr 7.4 and the search api module. I don´t find a way to configure the search api to get all indexed items by searching with ""(nothing an put enter) or searching by "*". How can i enable such a search behavior?
Thanks a lot
Tim
As upto my understanding on your question, You can Create Facets and configure the filters by specific taxonomy terms or content types. Before that check the fields what you are indexing into the solr.

How to prevent Apache Solr from returning "suites" when searching for "suits" and vice versa?

We are a listings/business directory company that uses Apache Solr 4.7.2. When we do a search for "suits" in "Melbourne", our top two results are hotels that contain the word "suites" and the rest of the results are tailors, clothing retailers, etc., as expected. How do I prevent Solr from including hotels/suites in a search for "suits"?
This is due to stemming. There are two ways to handle it:
Disable stemming completely by removing the stemming filter from schema.xml
use KeywordMarkFilter if you just want to exclude specific keywords from being stemmed. In this particular case you would create a protwords.txt file with two lines, "suits" and "suites" (and any other keyword you want to protect from stemming)

How to use lucene query syntax on Orchard CMS

I would like to use the full Lucene query syntax on an Orchard CMS based Website.
Currently, after enabling the indexing and search on Orchard, I can search on the website according to the fields I selected on the Orchard search administration page,
but I cannot perform one search on a particular field only (without changing the behavior on the entire search)
I cannot use fuzzy search...
From the logs, I can see that Orchard take care of that part (providing Lucene a good query syntax), but I would like to do it on my own.
For example, when searching "wel" on the website, Orchard will send to Lucene this query : title:wel* body:wel* (if I have the title and body fields activated on the search).
I did see some blogs that talk about coding some features to customize search, but I would like to be sure I'm not missing something before switching to developer mode :)
There are so many scenarios that can be done with search that there is no way to provide such coverage out of the box, which is why the API is very simple to use if you need custom searching capabilities.
You should copy-paste the controller from the search module and use the Parse() method of the ISearchBuilder with the escape parameter to false. This will parse a pure lucene query. You can also use the WithField("body", "value") to do simpler field search.
I don't believe anyone has released any modules that provide additional search functionality, because if you need it, it is so simple to develop ^_^ So yes, you will have to go dev mode to do custom field search

Adding a LIKE Finder on a Localized column in Liferay Service Builder

I have a column that have been set to Localized="true", is there a way to add a finder that only matches LIKE on specific locale?
Unfortunately, I don't think it would be possible: localized columns are stored as xml strings in db, and I haven't found any example of a search like this in Liferay source. Have you considered using the index? It would be way easier to do a LIKE query for a localized field.
You can use xPath (if you use a db engine that supports it, for example postgresql)

Resources