<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hiya Vinoth,<div><br></div><div>I just ran my tests locally, and they seem to be working fine.</div><div><br></div><div>My class in my test looks like this: -&nbsp;</div><div><br></div><div><div><font class="Apple-style-span" color="#0433FF">@ProvidedId(bridge = @FieldBridge(impl = StringBridge.class))</font></div><div><font class="Apple-style-span" color="#0433FF">@Indexed(index = "person")</font></div><div>public class Person implements Serializable {</div><div><font class="Apple-style-span" color="#0433FF">&nbsp;&nbsp; @Field(store = Store.YES)</font></div><div>&nbsp;&nbsp; private String name;</div><div><font class="Apple-style-span" color="#0433FF">&nbsp;&nbsp; @Field(store = Store.YES)</font></div><div>&nbsp;&nbsp; private String blurb;</div><div>&nbsp;&nbsp; <font class="Apple-style-span" color="#0433FF">@Field(store = Store.YES, index = Index.UN_TOKENIZED)</font></div><div>&nbsp;&nbsp; private int age;</div><div><br></div><div><br></div><div>Perhaps if you have a look at the differences between our annotations and have a play around you'll be able to find out what the issue is. I used exactly the same annotations as you did</div></div><div><br></div><div><br><div><div>On 19 Nov 2009, at 07:02, Vinoth wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">Hi,<br><br>I have a problem in getting through the querying feature of infinispan. I am using the technical preview listed in this <a href="http://www.jboss.org/community/wiki/QueryingInfinispan" target="_blank">wiki page</a> with the help of the sample code provided in the same page.<br>

<br>I used the following properties for the second argument in QueryHelper Constructor.<br>#hibernate.properties<br>hibernate.search.default.directory_provider org.hibernate.search.store.FSDirectoryProvider<br>hibernate.search.default.indexBase=/usr/vin/lucene/indexes<br>

<br>This is my class for Hibernate Search<br><br>@ProvidedId<br>@Indexed<br>public class Item {<br><br>&nbsp;&nbsp;&nbsp; @Field<br>&nbsp;&nbsp;&nbsp; private String name;<br>&nbsp;&nbsp;&nbsp; @Field<br>&nbsp;&nbsp;&nbsp; private String description;<br><br>...// getters and setters<br>

}<br><br>I have included the @ProvidedId since QueryHelper instantiation validates the classes based on this annotation.<br><i><b>Note ::</b> QueryHelper.validateClasses() -- This is to check that both the @ProvidedId is present and the the @DocumentId is not present. This is because don't want both of these 2 annotations used at the same time.</i><br>

<br>When I used the @Indexed annotation for the above class, it throws an exception while instantiating the QueryHelper.<br><br><font style="font-family: courier new,monospace;" size="2">&lt;Exception Snippet&gt;<br>java.lang.NullPointerException<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.hibernate.search.engine.DocumentBuilderIndexedEntity.init(DocumentBuilderIndexedEntity.java:151)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.hibernate.search.engine.DocumentBuilderContainedEntity.&lt;init&gt;(DocumentBuilderContainedEntity.java:93)<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.hibernate.search.engine.DocumentBuilderIndexedEntity.&lt;init&gt;(DocumentBuilderIndexedEntity.java:128)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.hibernate.search.impl.SearchFactoryImpl.initDocumentBuilders(SearchFactoryImpl.java:409)<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.hibernate.search.impl.SearchFactoryImpl.&lt;init&gt;(SearchFactoryImpl.java:119)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.infinispan.query.backend.QueryHelper.&lt;init&gt;(QueryHelper.java:87)<br>&lt;Exception Snippet&gt;</font><br>

<br>When I removed that @Indexed annotation, QueryHelper got instantiated but it throwed some exception when it hits CacheQuery.getBasicQuery() method, where it forms lucene query string with the help of QueryParser.<br>
<span style="font-family: courier new,monospace;"><br>
org.hibernate.HibernateException: There are no mapped entities. Don't forget to add @Indexed to at least one class.</span><br></div></blockquote><div><br></div><div>Yes, Hibernate Search will throw an exception if you don't specify if any of your classes are Entities. If there aren't any entities then it doesn't know what to index :-).</div><div><br></div><br><blockquote type="cite"><div class="gmail_quote"><br>Please let me know if I missed anything here.<br><br>Thanks in advance,<br></div>Vinoth<br>

_______________________________________________<br>infinispan-dev mailing list<br><a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/infinispan-dev</blockquote></div><br><div>
<div>Navin Surtani</div><div><br></div><div>Intern Infinispan</div><div>Intern JBoss Cache Searchable</div>
</div>
<br></div></body></html>