Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by ShalinMangar: http://wiki.apache.org/solr/Solrj The comment on the change is: Corrected bullet formatting ------------------------------------------------------------------------------ [[Anchor(pojo)]] === Directly adding POJOs to Solr === - * Create a Java bean with annotations. The [EMAIL PROTECTED] annotation can be applied to a field or a setter method. If the field name is different from the bean field name give the aliased name in the annotation itself as shown in the categories field. + * Create a Java bean with annotations. The [EMAIL PROTECTED] annotation can be applied to a field or a setter method. If the field name is different from the bean field name give the aliased name in the annotation itself as shown in the categories field. {{{ import org.apache.solr.client.solrj.beans.Field; @@ -122, +122 @@ } }}} - * Get an instance of server + * Get an instance of server {{{ SolrServer server = getSolrServer(); }}} - * Create the bean instances + * Create the bean instances {{{ Item item = new Item(); item.id = "one"; item.categories = new String[] { "aaa", "bbb", "ccc" }; }}} - * Add to Solr + * Add to Solr {{{ server.addBean(item); }}} - * Adding multiple beans together + * Adding multiple beans together {{{ List<Item> beans ; //add Item objects to the list @@ -163, +163 @@ {{{ SolrDocumentList docs = rsp.getResults(); }}} - * To read Documents as beans, the bean must be annotated as given in the [#pojo example]. + * To read Documents as beans, the bean must be annotated as given in the [#pojo example]. {{{ List<Item> beans = rsp.getBeans(Item.class); }}}
