Solr | Solr Indexer implementation for use in SI4T | Search Engine library
kandi X-RAY | Solr Summary
kandi X-RAY | Solr Summary
Solr Indexer implementation for use with SI4T. Checkout the Project Wiki or Project Website for more information. #Web 8 Upgrade Notes.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Commit the changes
- Adds all binary entries to Solr
- Helper method to commit the add content to Solr
- Get binary input stream
- Destroy all servers
- Destroy all HttpClient instances
- Adds a page to the index
- Removes an item from the index
- Adds a binary to the index
- Remove binary from index
- Updates an existing item in the index
- Sets the core name and Solr core core
- Configures the indexer
Solr Key Features
Solr Examples and Code Snippets
public void addSolrDocument(String documentId, String itemName, String itemPrice) throws SolrServerException, IOException {
SolrInputDocument document = new SolrInputDocument();
document.addField("id", documentId);
document.a
public void deleteSolrDocumentByQuery(String query) throws SolrServerException, IOException {
solrClient.deleteByQuery(query);
solrClient.commit();
}
public void deleteSolrDocumentById(String documentId) throws SolrServerException, IOException {
solrClient.deleteById(documentId);
solrClient.commit();
}
Community Discussions
Trending Discussions on Solr
QUESTION
I've seen the issue about accessing flux at the middle of an IntegrationFlow
and I wonder why I succeed writing logic inside the flux in the following way:
ANSWER
Answered 2022-Mar-28 at 15:26The logic you write in that e.reactive()
is not correct.
See documentation for that endpoint configurer option to understand its purpose:
QUESTION
So, i have a solr version 7.7.2 running in two different nodes. i wanted to copy the the index data from one to another. all the other config files remain the same (including core and solrconfig.xml). So I copy pasted the data directory and the configsets from one node to another.
Now open starting the server, I am getting this exception -
...ANSWER
Answered 2022-Mar-22 at 12:25As per @MatsLindh 's suggestion, I took backup of the existing core and then copied the data. The nodes are working fine now.
Thanks @MatsLindh for the help
QUESTION
I need to convert input attributes into SOLR request containing three sections, one of them is solrOptions. in my request I have:
...ANSWER
Answered 2022-Mar-12 at 11:12You can start with getting rid of "searchAttributes"
from modify transformation presuming the input is exactly
QUESTION
I have a Spring Boot (2.5) application in which I need to make a REST call to a remote system (a Solr instance where I store a denormalized view), in which I can either create or update records.
I don't really care about the response I get (and sometimes the remote system is slow to respond), so I am making an async call like this in createIndexForTicket
/ updateIndexForTicket
:
ANSWER
Answered 2022-Mar-07 at 08:34Here's the workaround that seems to work :
declare a threadExecutor :
QUESTION
When i'm searching for t-shirts on my solr, it returns shirts first. I configured my field as follows:
...ANSWER
Answered 2022-Jan-23 at 14:56Here you are using the StandardTokenizerFactory
for your field which is creating a token as shirt and hence a match.
StandardTokenizerFactory
:-
It tokenizes on whitespace, as well as strips characters
The Documentation for StandardTokenizerFactory
mentions as :-
Splits words at punctuation characters, removing punctuations. However, a dot that's not followed by whitespace is considered part of a token. Splits words at hyphens, unless there's a number in the token. In that case, the whole token is interpreted as a product number and is not split. Recognizes email addresses and Internet hostnames as one token.
If you want to perform search on the "t-shirt", then it should be tokenized.
I would suggest you to use the KeywordTokenizerFactory
Keyword Tokenizer does not split the input provided to it. It does not do any processing on the string, and the entire string is treated as a single token. This doesn't actually do any tokenization. It returns the original text as one term.
This KeywordTokenizerFactory
is used for sorting or faceting requirements, where one want to perform the exact match. Its helpful in faceting and sorting.
You can have another field and apply KeywordTokenizerFactory
to it and perform your search on it.
QUESTION
Recently a critical log4j vulnerability was discovered.
I want to upgrade the log4j as used by my current Solr instance, so I checked here.
However, I don't see a log4j.properties
file in "/server/resources/" folder.
All I see there is:
- jetty-logging.properties
- log4j2.xml
- log4j2-console.xml
None of these files contain a version. So to upgrade, is it safe to download the latest version of log4j and overwrite the existing jars in folder "\solr-8.10.1\server\lib\ext", or what are the recommended steps to upgrade?
...ANSWER
Answered 2021-Dec-13 at 15:51The link you're pointing to is for an older version of Solr (6.6 instead of 8.10.1). The correct version is https://solr.apache.org/guide/8_10/configuring-logging.html where it mentions using log4j 2.
The file log4j2.xml (and even `log4j.properties for that matter) configure the logging itself, not the version of log4j. So updating that file is irrelevant.
Here's what the project page recommends:
2021-12-10, Apache Solr affected by Apache Log4J CVE-2021-44228
...
Description: Apache Solr releases prior to 8.11.1 were using a bundled version of the Apache Log4J library vulnerable to RCE. For full impact and additional detail consult the Log4J security page.
...
Mitigation: Any of the following are enough to prevent this vulnerability for Solr servers:
- Upgrade to Solr 8.11.1 or greater (when available), which will include an updated version of the log4j2 dependency.
- Manually update the version of log4j2 on your runtime classpath and restart your Solr application.
- (Linux/MacOS) Edit your solr.in.sh file to include: SOLR_OPTS="$SOLR_OPTS -Dlog4j2.formatMsgNoLookups=true"
- (Windows) Edit your solr.in.cmd file to include: set SOLR_OPTS=%SOLR_OPTS% -Dlog4j2.formatMsgNoLookups=true
- Follow any of the other mitgations listed at https://logging.apache.org/log4j/2.x/security.html
What you're proposing (overwrite the existing jars in folder "\solr-8.10.1\server\lib\ext") seems like the second approach, so it should probably work fine. Just make sure this is the correct place that contains the log4j dependency.
QUESTION
I'm new to working with XML and XSD files. What I'm trying to do is validate an xml file using a schema. This is the start of my XML file:
...ANSWER
Answered 2022-Jan-14 at 15:06You have to somehow associate the XSD with the XML.
A common way to do this is to use noNamespaceSchemaLocation
for non-namespaced XML or schemaLocation
for namespaced XML. To use this approach, change
QUESTION
I've got a very old version of Solr and I've been trying to see if it is affected by the Log4Shell vulnerability that everybody is freaking out about (CVE-2021-44228).
The CVE only seems to apply to later versions, but a colleague doesn't buy it, so I'm trying to figure out the truth.
...ANSWER
Answered 2022-Jan-02 at 21:01I'm about 95% sure this is fine for older versions of Log4j. Three reasons:
I'm on version 1.2. I found the Log4j JAR file on my system, unzipped it, and looked for anything mentioning JNDI:
QUESTION
How to combine a nested query with a spatial filter in Apache Solr? This is a simplified nested query which should be combined with a spatial filter:
...ANSWER
Answered 2021-Nov-17 at 20:39The solution is:
QUESTION
For an e-commerce store I have two products like these indexed in Solr
- easyCover Silicone Protection Cover for Canon EOS 80D (Camouflage)
- Canon EOS 80D DSLR Camera with 18-135mm Lens
Now, for a search query "Canon EOS 80D", I am getting product ranked as 1,2 as a result.
How can I rank Product 2, which is "Canon EOS 80D DSLR Camera with 18-135mm Lens" rank first?
Basically, I want to give more boost/weight-age to the product that has term in the beginning of the name phrase compared to those product that has same term not the first in the name phrase.
Pls advise.
...ANSWER
Answered 2021-Oct-21 at 20:14I strongly advice not to use the token positions to boost your product over accessories. Imagine a customer is searching for "EOS 80D" - he will still get the silicone cover on first position.
A better solution would be to boost on a secondary field. Some ideas:
- put a boost function on the price, as the main products usually have
higher prices as the accessories e.g
bf=log(price)
- use a field to categorize your items in products and accessories - and put a boost on this, e.g.
bq=category:product
- create a field to list the products that an assessory can be used with. This will also help you to advertise the accessories in future. But it will now also help to find the main products, by boosting the the documents that don't contain references here.
I know that this answer is not a direct solution for the original question - but sometimes there are much simpler solutions for a problem if you look at it from a distance.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Solr
You can use Solr like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the Solr component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page