0
MONTREAL 1/3 JULY 2011Custom EOAdaptors (Plus ERSolr!)Travis BrittmDimension Technology
Custom EOAdaptors•   EOAdaptors connect EOF to a data store•   SQL stores most common•   Used to need an adaptor per datab...
Why Build a Custom EOAdaptor?•   You have to.•   You’re insane.
No SQL?•   Voldemort•   Neo4J•   Lucene•   Solr•   Cassandra•   That other thing...
Basic Requirements•   Schema support•   Query language (EOQualifiers)
Here Be Dragons•   WebObjects wiki has a high level overview:    http://wiki.objectstyle.org/confluence/display/WO/EOF-Usin...
EOAdaptorChannel•   Delete•   Insert•   Update•   Select
ERSolr•   Custom EOAdaptor•   Allows you to use Solr with EOF•   Entity Modeler, EOQualifiers, etc.
What is Solr?•   Apache project, part of Apache Lucene•   Uses Lucene index•   Adds support for schemas, facet querying, s...
WTH is a facet?
ERSolr•   Allows you model Solr schema with Entity Modeler (including    multi-value fields)•   Solr specific prototypes•   ...
Entity Modeler
ERXSolrFetchSpecificationERXSolrFetchSpecification fetchSpecification = new ERXSolrFetchSpecification<Inventory>(Inventory....
Get Facet Resultsfor (SolrFacet facet : fetchSpecification.facets()) {    NSArray<FacetItem> facetItems = fetchSpecificati...
ERXSolrFetchSpecification•   ERXSolrFetchSpecification.queryTime()•   ERXSolrFetchSpecification.maxTime()•   ERXSolrFetchSpec...
Other Stuff•   Result Scoring•   Field statistics•   Facet pivoting
DEMO(get ready to live!)
Where is this thing?•   If you’re watching this presentation in the future, it’s probably in    Wonder.•   Right now it’s ...
MONTREAL 1/3 JULY 2011Q&A
Upcoming SlideShare
Loading in...5
×

Custom EOAdaptors and ERSolr

565

Published on

EOF is a powerful object graph management framework that is often, but not always, used with a relational data store. Learn how to write custom EOAdaptors to talk to non-SQL data sources. We will cover handling transactions, query generation, and integration with Entity Modeler.

Learn also about ERSolr, a new EOAdaptor to talk to Apache's Solr.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
565
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Custom EOAdaptors and ERSolr"

  1. 1. MONTREAL 1/3 JULY 2011Custom EOAdaptors (Plus ERSolr!)Travis BrittmDimension Technology
  2. 2. Custom EOAdaptors• EOAdaptors connect EOF to a data store• SQL stores most common• Used to need an adaptor per database• JDBC made this a lot easier - Plugins
  3. 3. Why Build a Custom EOAdaptor?• You have to.• You’re insane.
  4. 4. No SQL?• Voldemort• Neo4J• Lucene• Solr• Cassandra• That other thing...
  5. 5. Basic Requirements• Schema support• Query language (EOQualifiers)
  6. 6. Here Be Dragons• WebObjects wiki has a high level overview: http://wiki.objectstyle.org/confluence/display/WO/EOF-Using+EOF-Custom+EOAdaptor• Create new Wonder framework• EOAdaptor subclass: set up connection and adaptor context• EOAdaptorContext subclass: set up transactions and adaptor channel• EOAdaptorChannel subclass: where you actually do stuff
  7. 7. EOAdaptorChannel• Delete• Insert• Update• Select
  8. 8. ERSolr• Custom EOAdaptor• Allows you to use Solr with EOF• Entity Modeler, EOQualifiers, etc.
  9. 9. What is Solr?• Apache project, part of Apache Lucene• Uses Lucene index• Adds support for schemas, facet querying, sharding, replication, superset of Lucene Query Language• Deploys in any servlet container, comes with Jetty• JSON “resty” interface / Java API• Scales like crazy
  10. 10. WTH is a facet?
  11. 11. ERSolr• Allows you model Solr schema with Entity Modeler (including multi-value fields)• Solr specific prototypes• Use EOQualifiers to query Solr, true batching• EOSortOrderings• ERXSolrFetchSpecification: support for facets, other Solr features
  12. 12. Entity Modeler
  13. 13. ERXSolrFetchSpecificationERXSolrFetchSpecification fetchSpecification = new ERXSolrFetchSpecification<Inventory>(Inventory.ENTITY_NAME);fetchSpecification.setBatchSize(5);// Field FacetsfetchSpecification.addFacet(SolrFacet.newSolrFacet(Inventory.IN_STOCK_KEY));// Query FacetsSolrFacet priceQueryFacet = SolrFacet.newSolrFacet(Inventory.PRICE_KEY);priceQueryFacet.addQualifierForKey(Inventory.PRICE.lessThanOrEqualTo(100), "Low Price");priceQueryFacet.addQualifierForKey(Inventory.PRICE.greaterThan(100), "High Price");fetchSpecification.addFacet(priceQueryFacet);// Put results in a display groupERXDisplayGroup displayGroup = new ERXDisplayGroup<Inventory>();displayGroup.setObjectArray(fetchSpecification.result().objects());
  14. 14. Get Facet Resultsfor (SolrFacet facet : fetchSpecification.facets()) { NSArray<FacetItem> facetItems = fetchSpecification.result().itemCounts(facet.key()); for (FacetItem facetItem : facetItems) { String displayValue = facetItem.key(); Number count = facetItem.count(); }}
  15. 15. ERXSolrFetchSpecification• ERXSolrFetchSpecification.queryTime()• ERXSolrFetchSpecification.maxTime()• ERXSolrFetchSpecification.batchNumber()• ERXSolrFetchSpecification.defaultFacetLimit()• ERXSolrFetchSpecification.defaultMinFacetSize()
  16. 16. Other Stuff• Result Scoring• Field statistics• Facet pivoting
  17. 17. DEMO(get ready to live!)
  18. 18. Where is this thing?• If you’re watching this presentation in the future, it’s probably in Wonder.• Right now it’s here: https://github.com/tbritt/ERSolr
  19. 19. MONTREAL 1/3 JULY 2011Q&A
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×