Semi Natural language Search using Apache Solr
<p>I did some analysis on Apache Solr and its pretty good to search data from various sources. 
The problem I am facing is how do I standardize my search grammar and translate search text into Solr query.</p>

<p>I have three types of file/database table to search from - namely Customer, Industry and Unit. The first keyword in the search box should be any of the three. After that, the user can define a fix set of criteria: </p>

<pre><code>Metrics : 0 or many (ex, exposure, income, revenue, loan_amt etc)
Dimension : 0 or many (Geography, region, etc)
</code></pre>

<p>Example:</p>

<pre><code>customer - Returns all customer data from customer core
customer income from Asia - Returns all customer income details who belongs to Asia 
customer income revenue from Asia - Returns all customer income and revenue details who belongs to Asia 
</code></pre>

<p>How can I translate the above natural language search text to solr query?
Can I fix my grammar of text in Solr like 
first keyword should be customer/industry/unit,
second key-value would be one or more region/geography
and then metric values. </p>

<p>I am not looking for google like search but a limited search where the user knows what to search. </p>