• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate Search in Action - application of 'Fieldable' lazy field

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I have a trade order execution system where the stock order once executed and confirmed, the complete order.xml is stored in an Oracle DB as a BLOB field. Now I have 2 fields which I need to index and search on: 1. The OrderId numeric field and the BLOB order.xml field.

Does Hibernate Search custom field bridge and a Lucene Fieldable lazy field implementation help in such a case to read the xml tags, extract the CDATA text and index on those words so as to become easier to be searchable by Broker Name, Customer Name, CUSIP Id, Stock Ticker, etc�
 
author
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Yes this is totally possible.
Your custom bridge will read and part the XML and put the attributes you want into the Lucene Document under the Fields you want.

Typically you will ahve something like that

public class Trade {
@Id @DocumentId Integer orderId;

@Field(bridge=@FieldBridge(impl=OrderXMLIndexer.class)
@Lob
byte[] orderXml;
}

OrderXMLIndexer will manipulate the Lucene Document and add fields to it:
- orderXml.brokerName
- orderXml.customerName
- ...

Note that the field name is customizable, Particularly, you do not have to prefix them by the property name (orderXml) though it is recommended.

Your Lucene query will look like
"orderXml.brokerName:Merril"
 
Dinesh Sundrani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bingoooo !!! That's really what I was looking for..

"orderXML.brokerName:MER"
"orderXML.brokerName:LEH"
"orderXML.brokerName:GS"
"orderXML.protfolioName:JeffersonCharitableTrust"
"orderXML.sellRecommendation:BUY"
"orderXML.ratingAgency:Fitch"


 
I yam what I yam and that's all that I yam - the great philosopher Popeye. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic