Lucene question

View: New views
4 Messages — Rating Filter:   Alert me  

Lucene question

by Torsten Schassan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I want to store the @xml:id of an element (facsimile) in the Lucene
index, defining:

<text match="//facsimile/@xml:id"/>

Why don't I get any results on the following query (and what should it
look like then)?

//facsimile/@xml:id[ft:query(., 'something')]

Best, Torsten

- --
Torsten Schassan
Herzog August Bibliothek, Postfach 1364, D-38299 Wolfenbuettel
Tel.: +49-5331-808-130, schassan {at} hab.de
  http://www.hab.de; http://www.hab.de/forschung/projekte/weiss64.htm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFK+rLiq4nZEP2KS4QRAlWOAJ9QjbQfX43acxLyAYaLE2lLVxT4XwCfXe1C
L1YF8juMejuJu0gh8tS04Xs=
=e0k5
-----END PGP SIGNATURE-----


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: Lucene question

by hst :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Torsten,

the exist-lucene documentation[1] says:

"Please note that the argument to match is a simple path pattern, not an XPath expression. It only allows / and // to denote a child or descendant step, plus the wildcard to match an arbitrary element." 

I think this might cause your problem.

Best,
Heiko

[1]http://demo.exist-db.org/lucene.xml#N10183



2009/11/11 Torsten Schassan <schassan@...>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I want to store the @xml:id of an element (facsimile) in the Lucene
index, defining:

<text match="//facsimile/@xml:id"/>

Why don't I get any results on the following query (and what should it
look like then)?

//facsimile/@xml:id[ft:query(., 'something')]

Best, Torsten

- --
Torsten Schassan
Herzog August Bibliothek, Postfach 1364, D-38299 Wolfenbuettel
Tel.: +49-5331-808-130, schassan {at} hab.de
 http://www.hab.de; http://www.hab.de/forschung/projekte/weiss64.htm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFK+rLiq4nZEP2KS4QRAlWOAJ9QjbQfX43acxLyAYaLE2lLVxT4XwCfXe1C
L1YF8juMejuJu0gh8tS04Xs=
=e0k5
-----END PGP SIGNATURE-----


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: Lucene question

by Torsten Schassan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Heiko,

> "Please note that the argument to match is a simple path pattern, not an
> XPath expression. It only allows / and // to denote a child or descendant
> step, plus the wildcard to match an arbitrary element."

(in general) I was aware of the fact but does this mean it is not
possible to store an attribute in the index?

Best, Torsten


- --
Torsten Schassan
Herzog August Bibliothek, Postfach 1364, D-38299 Wolfenbuettel
Tel.: +49-5331-808-130, schassan {at} hab.de
  http://www.hab.de; http://www.hab.de/forschung/projekte/weiss64.htm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFK+shpq4nZEP2KS4QRAh1CAKCCFXZWlc7lTh5lt5Z+e3GV33jTjgCdHsME
vaSxYJGpri49pYlRjnEQMsM=
=dC6a
-----END PGP SIGNATURE-----


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: Lucene question

by Joe Wicentowski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Torsten,

> (in general) I was aware of the fact but does this mean it is not
> possible to store an attribute in the index?

No, it is possible!  I store @id attributes using this index definition:

<lucene boost="1.0">
    <text qname="@id"/>
</lucene>

I can query this attribute as follows:

//volume[ft:query(./@id, 'frus*')]

Oddly, I notice that moving the attribute outside the predicate
returns no results for me either:

//volume/@id[ft:query(., 'frus*')]

So, I'd suggest trying (1) moving your attribute inside the predicate
and (2) confirm whether you need a wildcard ('*') or other Lucene
search operator to match the desired results.

Joe

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open