The SearchBlox API

What does the SearchBlox API allow you to do?

The REST based SearchBlox API allows you to add, update, delete a url and associated content in the search collection through a simple xml post in a language independent manner. For applications that require an easy way to make a document or url or any type of textual content searchable, we guarantee this is going to be faster than using Lucene or Solr from the ground up.

What are the use cases where the API can be used?

If you have a custom application or system where you would like to have complete control over what gets indexed and made searchable including the ability to combine multiple sources of textual content, the API can help you accomplish that very easily.

#1 Indexing urls that your users have submitted or bookmarked or marked favorites

All you need to do is make a simple http post to the url  http://localhost:8080/searchblox/api/rest/add with the following xml message

<?xml version=”1.0″ encoding=”utf-8″?>
<searchblox apikey=”16B93E58632880A80E0CE88F440981DB”>
<document colname=”Custom_Collection” location=”https://www.searchblox.com/”>
</document>
</searchblox>

That’s it! SearchBlox will retrieve the url https://www.searchblox.com/, index it and make it searchable instantly. You can override any of the fields by providing the field value. For example, if you want to override the title with “Hello World” instead of the original page title, you provide that value in the message.

<?xml version=”1.0″ encoding=”utf-8″?>
<searchblox apikey=”16B93E58632880A80E0CE88F440981DB”>
<document colname=”Custom_Collection” location=”https://www.searchblox.com/”>
<title>Hello World</title>
</document>
</searchblox>

To delete the same document from the index, you would make a post to the delete url http://localhost:8080/searchblox/api/rest/delete with the xml message

<?xml version=”1.0″ encoding=”utf-8″?>
<searchblox apikey=”16B93E58632880A80E0CE88F440981DB”>
<document colname=”Custom_Collection” location=”https://www.searchblox.com/”>
</document>
</searchblox>

#2 Indexing custom content that is generated from multiple sources

You can submit any of fields that SearchBlox allows without having a url or document provided to SearchBlox. For example, if you would like to index records from a custom data source with only title and description fields, then you can create the following xml message :

<?xml version=”1.0″ encoding=”utf-8″?>
<searchblox apikey=”16B93E58632880A80E0CE88F440981DB”>
<document colname=”Custom_Collection”>
<uid>1000</uid>
<title>Hello World</title>
<description>This is the description</description>
</document>
</searchblox>

These results can be mixed with standard search results and are made available instantly. The documentation provides a detailed list of fields and values that are acceptable for indexing and searching using the API. The SearchBlox API masks the complexities of Lucene and lets you focus on your information that needs to be made searchable.