Struggling with learning solr
I am in the process of redesigning one of our companies site. My boss wants to play around with the idea of replacing all of our navigation with a search box.. the search box should be able to query any of our tables of unrelated data.

So right now I am trying it with 5 tables.

Products
Manufacturers
Category
Ingredients
Uses


So should be able to lookup a product name, a manufacturer name, a category name, an ingredient name, or a use name

When I retrieve the results. if the user clicked on a manufacturer search result.. It will take them to a manufacturer page that lookups all products for that manufacturer. 
When clicks on a product page.. link will take them to that actual product information.
Ingredient will take them to a page that will show all products containing that ingredient.

Anyways here is my data config


<dataConfig>
    <dataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/xxx" user="xxx" password="xxx" />
    <document>
		<entity name="manufacturer" transformer="TemplateTransformer" pk="manNum"
			query="SELECT manNum, manName FROM manufacturer
				WHERE active = 1">
			<field column="id" name="id" template="MAN-${manNum}" />
			<field column="type" template="manufacturer" name="type"/>
			<field column="manName" name="text"/>		
			<field column="manNum" name="manNum"/>
		</entity>
		
		<entity name="product" transformer="TemplateTransformer"
			query="SELECT products.prodNum, products.prodName as text, m.manName FROM products  JOIN man m USING (manNum) 
				WHERE products.active = 1
				AND (hideWeb = 0 or hideWeb IS NULL)">
			<field column="id" template="PROD-${products.prodNum}" name="id"/>
			<field column="type" template="product" name="type"/>
			<field column="text" name="text"/>
			<field column="manName" name="manName"/>
		</entity>
		
		
		<entity name="ingredients" transformer="TemplateTransformer" pk="id"
			query="SELECT id, text FROM inglist WHERE sort != ''">
			<field column="id" name="id" template="ING-${inglist.id}"/>
			<field column="type" template="ingredient" name="type"/>
			<field column="text" name="text" />
		</entity>
		
		<entity name="uses" transformer="TemplateTransformer" pk="id"
			query="SELECT id, text FROM useslist">
			<field column="id" name="id" template="USE-${id}"/>
			<field column="type" template="use" name="type"/>
			<field column="text" name="text"/>
		</entity>
		
		<entity name="categories" transformer="TemplateTransformer" pk="id"
			query="SELECT id, textShow as text FROM categorylist">
			<field column="id" name="id" template="CATEGORY-${id}"/>
			<field column="type" template="category" name="type"/>
			<field column="text" name="text"/>
		</entity>
		
		
    </document>
</dataConfig>



And my schema..

	<fields>
		<field name="id" type="string" indexed="true" stored="true"/>
		<field name="text"			indexed="true"	stored="true" type="text"/>
		<field name="type" type="string" indexed="false" stored="true"/>
		<field name="manName" type="text" indexed="false" stored="true"/>
		<field name="manNum" type="string" indexed="false" stored="false"/>
	</fields>

Now perhaps I am not doing this the right way... and there may be a better way to handle this.

Anyways the problem I am running into right now is that I am getting the error missing required field "id". Now products query and manufacturer query does not have an id column in the select.. but I thought the transform query should take care of it? If I do the select prodNum as id .. then all the ids are overwritting each other.
 
Struggling with learning solr
===

I am in the process of redesigning one of our companies site. My boss wants to play around with the idea of replacing all of our navigation with a search box.. the search box should be able to query any of our tables of unrelated data.

So right now I am trying it with 5 tables.

Products
Manufacturers
Category
Ingredients
Uses


So should be able to lookup a product name, a manufacturer name, a category name, an ingredient name, or a use name

When I retrieve the results. if the user clicked on a manufacturer search result.. It will take them to a manufacturer page that lookups all products for that manufacturer. 
When clicks on a product page.. link will take them to that actual product information.
Ingredient will take them to a page that will show all products containing that ingredient.

Anyways here is my data config


<dataConfig>
    <dataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/xxx" user="xxx" password="xxx" />
    <document>
		<entity name="manufacturer" transformer="TemplateTransformer" pk="manNum"
			query="SELECT manNum, manName FROM manufacturer
				WHERE active = 1">
			<field column="id" name="id" template="MAN-${manNum}" />
			<field column="type" template="manufacturer" name="type"/>
			<field column="manName" name="text"/>		
			<field column="manNum" name="manNum"/>
		</entity>
		
		<entity name="product" transformer="TemplateTransformer"
			query="SELECT products.prodNum, products.prodName as text, m.manName FROM products  JOIN man m USING (manNum) 
				WHERE products.active = 1
				AND (hideWeb = 0 or hideWeb IS NULL)">
			<field column="id" template="PROD-${products.prodNum}" name="id"/>
			<field column="type" template="product" name="type"/>
			<field column="text" name="text"/>
			<field column="manName" name="manName"/>
		</entity>
		
		
		<entity name="ingredients" transformer="TemplateTransformer" pk="id"
			query="SELECT id, text FROM inglist WHERE sort != ''">
			<field column="id" name="id" template="ING-${inglist.id}"/>
			<field column="type" template="ingredient" name="type"/>
			<field column="text" name="text" />
		</entity>
		
		<entity name="uses" transformer="TemplateTransformer" pk="id"
			query="SELECT id, text FROM useslist">
			<field column="id" name="id" template="USE-${id}"/>
			<field column="type" template="use" name="type"/>
			<field column="text" name="text"/>
		</entity>
		
		<entity name="categories" transformer="TemplateTransformer" pk="id"
			query="SELECT id, textShow as text FROM categorylist">
			<field column="id" name="id" template="CATEGORY-${id}"/>
			<field column="type" template="category" name="type"/>
			<field column="text" name="text"/>
		</entity>
		
		
    </document>
</dataConfig>



And my schema..

	<fields>
		<field name="id" type="string" indexed="true" stored="true"/>
		<field name="text"			indexed="true"	stored="true" type="text"/>
		<field name="type" type="string" indexed="false" stored="true"/>
		<field name="manName" type="text" indexed="false" stored="true"/>
		<field name="manNum" type="string" indexed="false" stored="false"/>
	</fields>

Now perhaps I am not doing this the right way... and there may be a better way to handle this.

Anyways the problem I am running into right now is that I am getting the error missing required field "id". Now products query and manufacturer query does not have an id column in the select.. but I thought the transform query should take care of it? If I do the select prodNum as id .. then all the ids are overwritting each other.
 