Order Search in OFBiz Powered by Solr

Pranay PandeyPublished: Updated:

Apache OFBizApache Solr

While evaluating an E-commerce ERP platform for your business, enterprise search will likely be one of the requirements. Having Google-like quick, relevant, and auto-suggestion enabled search throughout your applications, can be a complete game changer. This can directly impact staff productivity and turn around time for the completion of certain tasks.

How can it help?

Here are a couple of examples where it can be of great help.  It is not limited to these two areas and it can be expanded to any level.

Customer Service

Your Customer Service department becomes efficient and more productive if it can quickly find customer profiles, orders, and products quickly. It also helps reduce turn around time in answering customer questions.

Warehouse and Fulfillment

Your order fulfillment staff becomes efficient and more productive if it can quickly identify orders ready for picking, packing, and shipping leading to quicker order fulfillment.  Good search can also aid in determining inventory availability.

Order Search Powered by Apache Solr

In my earlier blog post we used the OFBiz example component to demonstrate the use of Apache Solr search. In this post we will look at a real world example using Solr search. We will implement search for orders using Solr, with facets on order status and the sales channel.

We will assume you have already downloaded and setup Apache Solr and Apache OFBiz on your local computer.  If not, you can find details for the set up here.

Now I am trying to provide some development references. In this post we will mainly focus on the service part of the implementation, where we will create order documents, index those, and do a search query. Complete working code can be referenced from here.

Property Setup in OFBiz

Code reference available on GitHub here.

Defining Document Schema in Solr

Creating Document and Indexes for Solr in OFBiz

Code reference available on GitHub here.

Service Definition-

SECA Rules-

Code reference available on GitHub here.

Service Implementation-

Code reference available on GitHub here.

Searching

Code reference available on GitHub here.

GetOrderSearchFacets.groovy

SearchOrderByFilters.groovy

A complete working component named ordersearchsolr along with sample order webapp is available on GitHub under evolvingofbiz setup (you will find ordersearchsolr in hot-deploy directory as its committed there). You can setup this codebase which leverages OFBiz 13.07 from GitHub.

This codebase will give you will give you results as shown in below given image as you access url – https://localhost:8443/orders (after creating some orders from ordermgr)

Order Search Solr

If you want to know more about enterprise search as part of your e-commerce or ERP project contact us today.

Pranay Pandey About Pranay Pandey
Pranay Pandey has been in the software industry since 2006. He specializes in Enterprise Software Design and Development. At HotWax he currently leads the effort of architecting quality software products and training resources. He continues to be dedicated to the Apache OFBiz open source project since 2007 and became a committer in 2014. He leads our internal training programs in Apache OFBiz, ERP and new technologies under the roof of HotWax University. He is an Electronics graduate and has a masters degree in Computer Applications from Rajeev Gandhi Technical University, Bhopal (M.P.) India. He loves learning and sharing knowledge. He believes that one of the keys to success in this industry is to "keep learning". His hobbies are reading, writing, walking, running, cycling, cooking and watching science fiction movies.

Leave a Reply

Your email address will not be published. Required fields are marked *