Lubos,
I tried to open and query the index in this way:

            Directory directory = FSDirectory.getDirectory("<path to
my index>", false);

            IndexSearcher searcher = new IndexSearcher(directory);
            RegexQuery rq = new RegexQuery(new Term("refs", "<REGEXP>"));

            rq.setRegexImplementation(new JavaUtilRegexCapabilities());
            Hits h = searcher.search(rq)

but unfortunately when I dump h.length() I always get back 0. The same problem
occurs if I change the term field from 'refs' to 'defs'.

What's wrong?




On Thu, Feb 2, 2012 at 2:22 PM, Lubos Kosco <lubos.ko...@oracle.com> wrote:
>
> There are bugs on that where I documented the prereqs, start here:
> http://defect.opensolaris.org/bz/show_bug.cgi?id=15736
>
> afaik regexp search needs csae sensitive index - so I think you can do it
> for def and ref search
> for full search you will need to create also case sensitive lucene index
>
> hth
> L
>
>
> On 2.2.2012 14:58, Jerrie Union wrote:
>>
>> Hi folks,
>> I'm looking to find a way to specify a regular expression in my search
>> queries but so far
>> I didn't succeed. I tried to use the RegexQuery() here recommended:
>>
>> http://mail.opensolaris.org/pipermail/opengrok-discuss/2007-December/000745.html
>> but I didn't succeed because some time I get back an empty document
>> set, some other
>> I get back an exception and last but not least I'm not sure that's a
>> good solution
>> as well as not being confident about the reliability of that class
>> which lies under the contrib
>> dir in Lucene source tree.
>>
>> I'm wondering if there are some more people trying to implement this
>> search functionality and what's
>> their opinion/recommendation.
>>
>> Thanks.
>> _______________________________________________
>> opengrok-discuss mailing list
>> opengrok-discuss@opensolaris.org
>> http://mail.opensolaris.org/mailman/listinfo/opengrok-discuss
>
>
_______________________________________________
opengrok-discuss mailing list
opengrok-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opengrok-discuss

Reply via email to