|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
firstinfield and position attributes usageHi,
I have problems using firstinfield and position attributes and then querying with @attr 3=1. Indeed, some users would find it cool to search anatomy only with the beginning of the phrase. First of all, I wonder how I can define a custom index and use it. It seems that using completeness attribute implies @attr 6=1 if 0 @attr 6=2 or @attr 6=1. position is not defined in you documentation. firstinfield seems to be used along with it. I tried to define : index h completeness 0 position 1 firstinfield 1 charmap sort-string-utf.chr in default.idx and used it in record.abs : melm 250$a Heading, Heading:h, Heading:s and queried my base as such : f @and @attr "1=Authority/format-id" @attr 5=100 MSC @attr "1=Heading" @attr 3=1 An Answer was : ERROR 119 Is there something I missed ? -- Henri Damien LAURENT et Paul POULAIN Consultants indépendants en logiciels libres et bibliothéconomie (http://www.koha-fr.org) _______________________________________________ Koha-zebra mailing list Koha-zebra@... http://lists.nongnu.org/mailman/listinfo/koha-zebra |
|
|
Re: firstinfield and position attributes usageHenri-Damien LAURENT wrote:
>Hi, >I have problems using firstinfield and position attributes and then >querying with @attr 3=1. >Indeed, some users would find it cool to search anatomy only with the >beginning of the phrase. > > >First of all, I wonder how I can define a custom index and use it. >It seems that using completeness attribute implies @attr 6=1 if 0 @attr >6=2 or @attr 6=1. >position is not defined in you documentation. >firstinfield seems to be used along with it. > > Zebra at present does not support the first-in-field attribute, although we sometimes have talked about doing so. You can simulate it pretty well by using a combination of complete subfield and truncation. You'll note there's also a way to configure an index to ignore leading articles (the, an, a, etc.), which is a good way to increase your recall.. yes, it's hard to make this word with word boundaries, (Adam might have a suggestion for some regexp magic that would work), but I think that's probably a minor problem in most cases. --Sebastian >I tried to define : > >index h >completeness 0 >position 1 >firstinfield 1 >charmap sort-string-utf.chr > >in default.idx and >used it in record.abs : >melm 250$a Heading, Heading:h, Heading:s > >and queried my base as such : >f @and @attr "1=Authority/format-id" @attr 5=100 MSC @attr "1=Heading" >@attr 3=1 An > >Answer was : >ERROR 119 > >Is there something I missed ? > > > -- Sebastian Hammer, Index Data quinn@... www.indexdata.com Ph: (603) 209-6853 Fax: (866) 383-4485 _______________________________________________ Koha-zebra mailing list Koha-zebra@... http://lists.nongnu.org/mailman/listinfo/koha-zebra |
|
|
Re: firstinfield and position attributes usageHenri-Damien LAURENT wrote:
> Hi, > I have problems using firstinfield and position attributes and then > querying with @attr 3=1. > Indeed, some users would find it cool to search anatomy only with the > beginning of the phrase. > > > First of all, I wonder how I can define a custom index and use it. > It seems that using completeness attribute implies @attr 6=1 if 0 @attr > 6=2 or @attr 6=1. > position is not defined in you documentation. > firstinfield seems to be used along with it. > > I tried to define : > > index h > completeness 0 > position 1 > firstinfield 1 > charmap sort-string-utf.chr > > in default.idx and > used it in record.abs : > melm 250$a Heading, Heading:h, Heading:s > > and queried my base as such : > f @and @attr "1=Authority/format-id" @attr 5=100 MSC @attr "1=Heading" > @attr 3=1 An > > Answer was : > ERROR 119 Your index named 'h' is not used for "normal" searches. The structure and sometimes the completeness attribute tell _what_ index type to use. If no structure is given .. and completeness is omitted or set to 1 (incomplete subfield) then index 'w' is used. Not your index 'h'. The error message suggests that firstinfield is not enabled for your index 'w'. You can either just enable firstinfield for 'w' .. It's already enabled for 'w' in tab/default.idx that comes with Zebra 2.0. But probably you don't use that. You can also just specify that you want to use index 'h' in your query by using structure=h (@attr 4=h). This structure hack requires Zebra 2.0.14. / Adam > > Is there something I missed ? > _______________________________________________ Koha-zebra mailing list Koha-zebra@... http://lists.nongnu.org/mailman/listinfo/koha-zebra |
| Free embeddable forum powered by Nabble | Forum Help |