Friday, April 22, 2016

Delete sitecore item from solr index through browser only, without rebuild-index

Delete sitecore item from solr index through browser only, without rebuild-index

There might be some situation in which you just want to delete the document/sitecore item from solr index without rebuild index means on the fly.


So below is the direct query to run on browser to delete the item from solr index


Replace your Solr instance (http://localhost:8999/solr)

Primary Field : Item_id(replace your Primary field of index)

Replace your primary field with value(<query>item_id:"{5674B119-E061-41B4-918C-BE5DE9FCC7A6}"</query>)

I Hope this helps to you.

Happy Sitecore







Sitecore :Update Solr index item through web admin panel

Sitecore :  how to update the Solr index item/document through web admin panel

I have covered the basic solr search queries in my previous post Link
).

If developer wants to update the single document/item from the solr index then question comes in the mind how?

There are two ways to update single item from solr index:

  1. Through code via API or
  2. Through Solr web Admin panel

Check the second way:

Update Request handler

Update request handler is responsible for update operation in solr index
  1. Open solr web admin:
  2. Go to Documents in left panel
  3. Select /update in request-handler
  4. Select document type as JSON
  5. Write update query in below format(primary field name with other field-value)
  6. Submit document




                     
Check the result in right panel as below:

                                 





Thanks Guys,

Happy Solr/Sitecore


Search Sitecore items from solr index through web admin panel

Search Sitecore items/Documents from solr index through web admin panel

Hi guys, in this blog I am trying to highlight some important queries of solr index that we can execute through solr web admin panel itself.

Most of the times we need to find out some items/results from index file based on some basic queries for diagnose purpose like Keyword search, wildcard search, Range Search, AND, OR condition etc.
So to achieve  the above search operation,

Go to solr admin> http://localhost:8999/solr/ (changed your solr instance name) > Query Tab>




Query panel

Now the most important part of this console panel is Query page, this page is very important from developer point of view to get the document from the index based on some parameter.

So there is some default parameter for query the document from solr index:

Parameter name
Default
Modified
Request handler
Select

Q
Query by default *:*
Change as per need
Sort

For sorting: can provide field name
start, rows
By default 0,10 (return 10 documents)
Can change like 0,50(to return 50 document)
Wt
Json(Result format)
Can change like xml(result will come in xml format)


Below are the some basic query snippets for search the item from solr index

Statement
Query Syntax
Description
Select All
*:*
return all documents without any filter
Keyword Search
Phrase Search

Filed name: “value”  (Example Product:”Sitecore”  
Return all result where Product exact match with “sitecore”
FieldName: Value AND FieldName: Value (example Product:”sitecore” And Title:”Demo”
AND operator matching the field value with and condition
OR Condition
FieldName: Value OR FieldName: Value (example Product:”sitecore” OR   Title:”Demo”
OR operator matching the field value with OR condition
Wildcard Search
FieldName: Value*(Example product:sitecore*
Search all product that start from sitecore
Range Search
FieldName:[ value TO Value](Example mod_date:[20020101 TO 20030101]
Range Queries allow one to match documents whose field(s) values are between the lower and upper bound specified by the Range Query


Run > execute query > show the result in right panel.

I hope you enjoyed this articleJ

Happy sitecore