About solr auto complete query and integrating in the html - solr

Could some provide inputs for the below
1>I want to use solr auto complete feature.If i have a core as abc, what will the solr query say for search key word "spell check".
2> How to build the query in AEM CQ5 using solrj could it be using jquery.Any sample code will be helpfull??
Thanks

look at example hope so it will help you.
https://examples.javacodegeeks.com/enterprise-java/apache-solr/solr-autocomplete-example/

Related

Solr dynamic schema updation using solrj

I am a new to solr working on solr version 4.8.0. I want to add/update/delete fields in the schema.xml at runtime using solrj. i can create or delete a core using solrj.
For adding documents or search using solrj, i referred this link
I want to learn advance functionality in solrj. I need any good tutorials or example code.
Can anyone please guide me?
Thanks in advance.
Solrj version 5.3 (features) introduced an experimental Schema API.
I think this page - https://wiki.apache.org/solr/SchemaRESTAPI contains all you need. Pay attention to Modifying the schema section. Although, it's not SolrJ way but it will work fine for you.

How to index data using solr from another server?

I have some .xml file on window server. And my solr is running on another ubuntu server.
I want to index these files using solr. How to do this? plz help me to resolve this issue.
You can use the DataImport tool of SOLR which helps you to easily import an XML from Solr's web interface.
see the example of wikipedia here

Part-of-speech tagger mapping in Solr

I am currently using Apache Solr to build a search engine. The queries in Solr are of the field:value format. Now I want to use a part-of-speech tagger to separate the subject, verb and predicate and search the values in each fields. For example, if I input "Who likes Starbucks" then I need some code to give me "q=subject:*&verb=likes&object=starbucks". Is there any library that can handle this job? Thank you!
I think several people have used UIMA for this, see solr wiki
There are a number of POS taggers. Here is another StackOverflow posting about this: What is a good Java library for Parts-Of-Speech tagging?

Solr's schema and how it works

Hey so I started researching about Solr and have a couple of questions on how Solr works. I know the schema defines what is stored and indexed in the Solr application. But I'm confuse as to how Solr knows that the "content" is the content of the site or that the url is the url?
My main goal is I'm trying to extract phone numbers from websites and I want Solr to nicely spit out 1234567890.
You need to define it in Solr schema.xml by declaring all the fields and its field type. You can then query Solr for any field to search.
Refer this: http://wiki.apache.org/solr/SchemaXml
Solr will not automatically index content from a website. You need to tell it how to index your content. Solr only knows the content you tell it to know. Extracting phone numbers sounds pretty simple so writing an update script or finding one online should not be an issue. Good luck!

Index my own data in Solr

I am new to Solr and have a couple of questions to ask help from more experienced people:
I am able to get example running, however what is exactly the start.jar?
I know by running "java -jar start.jar", i can start solr. But do i run this command after i index my own data, not the given sample data? if not, what should i do to run my own solr instance with my own indexed data?
I do need to index my own sample data, not related to the given example solr thing at all. How exactly should i do it? Should i copy the example directory then modify the fields in sechema.xml? should i then run the post.sh accordingly to index the data like what i did to set up the example solr?
Thanks a lot for your help!
Steps:
Decide what will be the document structure u store in SOLR. (Somewhat like creating the schema of a relational DB for one table).
remove the example core and create your own core with that schema
once the schema works with no errors (you check the server logs that hosts the SOLR app) You can start feed the data you have into SOLR. You POST it via HTTP in a specific structure which is documented in the SOLR Wiki. Various frameworks have some classes to handle that.
Marked as Wiki as this is too broad an answer for someone who did not bother to RTFM...
Dear custom indexing is not a difficult task as I have worked on it just a few days ago. First you need to write your documnet is xml,csv or json( format supported in solr) containing fields according to your schema.xml, then run following command in example/exampledocs
For a document mydoc.xml
./post.sh mydoc.xml
if in output, status value is 0 then indexing is successful and you can search your document in solr
Reference:http://www.solrtutorial.com/solr-in-5-minutes.html
Though the question is old, but I am writing for new visitors with same issue. The question can't be answered in few words. You must understand what Solr is, whats Solr Admin UI, why we need Solr instead a relational database. Then you can understand how to import sample data. I have recently published two articles i.e. Solr Introduction and Importing Sample Data, these might be helpful for you.
http://www.devtrainings.com/2017/03/apache-solr-introduction-and-server.html
http://www.devtrainings.com/2017/03/apache-solr-index-data-and-run-search.html

Resources