-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hiberante Search + Lucene AND Query
PostPosted: Fri Apr 12, 2013 2:05 am 
Newbie

Joined: Fri Apr 12, 2013 1:46 am
Posts: 1
I have one table in which I have insert file_name and file_data(Blob). I need to search Data like file_data:'ABC' this works and gives me proper result.
But now I want to fire AND Query like want to search result with file_name and file_result both.. How to search this?

like file_name:XYZ and file_data:'ABC'

I have created one query like ...

Code:
Query luceQry3 = queryBuilder
                  .bool()
                  .must(
                        queryBuilder
                        .bool()
                           .must(
                                 queryBuilder.
                                 keyword().
                                 onField("file_data")
                                 .ignoreFieldBridge()
                                 .matching("HDFC")
                                 .createQuery()).createQuery())
                  .must(queryBuilder.
                        keyword().
                        onField("fileName")
                        .ignoreFieldBridge()
                        .matching("0_119.pdf")
                        .createQuery()).createQuery();


but above query returns same result as when I search only file_data..

Please help me out.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.