You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Søren Hilmer <sh...@widetrail.dk> on 2008/03/29 23:40:46 UTC
indexing design document
Have I missed something?
I am trying to put the below design document into couch, but it complaints
with an error saying: Bad special document member: _fulltext_options
Is _fulltext_options something that needs to be added into couch itself? If so
I have missed that requirement in our discussion.
{
"_id":"_design/fulltextsearch",
"_rev":"123",
"_fulltext_options": {
"views": {
"names" : {"index":"view-value", "return":"document"},
"cities": {"index":"view-key", "return":"view-value"}
}
}
}
Have fun
Søren
--
Søren Hilmer, M.Sc., M.Crypt.
wideTrail Phone: +45 25481225
Pilevænget 41 Email: sh@widetrail.dk
DK-8961 Allingåbro Web: www.widetrail.dk
Re: indexing design document
Posted by Søren Hilmer <sh...@widetrail.dk>.
Yes, I figured that the _ prefix was reserved.
I was just wondering if the intent was to add the _fulltext_options into the
core, and in that case I had missed this intent.
This clarifies that the _ prefix was just an oversight in the suggestion then.
Thanks
Søren
On Sunday 30 March 2008 00:20, Jan Lehnardt wrote:
> On Mar 29, 2008, at 16:58 , Damien Katz wrote:
> > Field names must not start with an underscore as they are reserved
> > for CouchDB, that's why you get the error. Just rename it to
> > "fulltext_options" and it should work.
>
> To clarify, in case you are wondering why fulltext search is not
> considered being inside CouchDB. The fulltext search system is not
> part of the core functionality, so it doesn't have access to the
> underscore fields.
>
> Cheers
> Jan
> ==
>
> > On Mar 29, 2008, at 6:40 PM, Søren Hilmer wrote:
> >> Have I missed something?
> >> I am trying to put the below design document into couch, but it
> >> complaints
> >> with an error saying: Bad special document member: _fulltext_options
> >>
> >> Is _fulltext_options something that needs to be added into couch
> >> itself? If so
> >> I have missed that requirement in our discussion.
> >>
> >> {
> >> "_id":"_design/fulltextsearch",
> >> "_rev":"123",
> >> "_fulltext_options": {
> >> "views": {
> >> "names" : {"index":"view-value", "return":"document"},
> >> "cities": {"index":"view-key", "return":"view-value"}
> >> }
> >> }
> >> }
> >>
> >> Have fun
> >> Søren
> >>
> >> --
> >> Søren Hilmer, M.Sc., M.Crypt.
> >> wideTrail Phone: +45 25481225
> >> Pilevænget 41 Email: sh@widetrail.dk
> >> DK-8961 Allingåbro Web: www.widetrail.dk
--
Søren Hilmer, M.Sc., M.Crypt.
wideTrail Phone: +45 25481225
Pilevænget 41 Email: sh@widetrail.dk
DK-8961 Allingåbro Web: www.widetrail.dk
Re: indexing design document
Posted by Jan Lehnardt <ja...@apache.org>.
On Mar 29, 2008, at 16:58 , Damien Katz wrote:
> Field names must not start with an underscore as they are reserved
> for CouchDB, that's why you get the error. Just rename it to
> "fulltext_options" and it should work.
To clarify, in case you are wondering why fulltext search is not
considered being inside CouchDB. The fulltext search system is not
part of the core functionality, so it doesn't have access to the
underscore fields.
Cheers
Jan
==
>
> On Mar 29, 2008, at 6:40 PM, Søren Hilmer wrote:
>
>> Have I missed something?
>> I am trying to put the below design document into couch, but it
>> complaints
>> with an error saying: Bad special document member: _fulltext_options
>>
>> Is _fulltext_options something that needs to be added into couch
>> itself? If so
>> I have missed that requirement in our discussion.
>>
>> {
>> "_id":"_design/fulltextsearch",
>> "_rev":"123",
>> "_fulltext_options": {
>> "views": {
>> "names" : {"index":"view-value", "return":"document"},
>> "cities": {"index":"view-key", "return":"view-value"}
>> }
>> }
>> }
>>
>> Have fun
>> Søren
>>
>> --
>> Søren Hilmer, M.Sc., M.Crypt.
>> wideTrail Phone: +45 25481225
>> Pilevænget 41 Email: sh@widetrail.dk
>> DK-8961 Allingåbro Web: www.widetrail.dk
>
>
Re: indexing design document
Posted by Damien Katz <da...@gmail.com>.
Field names must not start with an underscore as they are reserved for
CouchDB, that's why you get the error. Just rename it to
"fulltext_options" and it should work.
-Damien
On Mar 29, 2008, at 6:40 PM, Søren Hilmer wrote:
> Have I missed something?
> I am trying to put the below design document into couch, but it
> complaints
> with an error saying: Bad special document member: _fulltext_options
>
> Is _fulltext_options something that needs to be added into couch
> itself? If so
> I have missed that requirement in our discussion.
>
> {
> "_id":"_design/fulltextsearch",
> "_rev":"123",
> "_fulltext_options": {
> "views": {
> "names" : {"index":"view-value", "return":"document"},
> "cities": {"index":"view-key", "return":"view-value"}
> }
> }
> }
>
> Have fun
> Søren
>
> --
> Søren Hilmer, M.Sc., M.Crypt.
> wideTrail Phone: +45 25481225
> Pilevænget 41 Email: sh@widetrail.dk
> DK-8961 Allingåbro Web: www.widetrail.dk
Re: indexing design document
Posted by Søren Hilmer <sh...@widetrail.dk>.
On Sunday 30 March 2008 00:31, Chris Anderson wrote:
> On Sat, Mar 29, 2008 at 3:40 PM, Søren Hilmer <sh...@widetrail.dk> wrote:
> > Have I missed something?
> > I am trying to put the below design document into couch, but it
> > complaints with an error saying: Bad special document member:
> > _fulltext_options
> >
> > Is _fulltext_options something that needs to be added into couch itself?
> > If so I have missed that requirement in our discussion.
> >
> > {
> > "_id":"_design/fulltextsearch",
> > "_rev":"123",
> > "_fulltext_options": {
> > "views": {
> > "names" : {"index":"view-value", "return":"document"},
> > "cities": {"index":"view-key", "return":"view-value"}
> > }
> > }
> > }
> >
> > Have fun
> > Søren
>
> Søren,
>
> It's awesome that you are digging into this! I was thinking about the
> fulltext_options schema, and it seems it could be simplified a little
> by restricting the options for the "return" value to either "document"
> or "view". Otherwise surely people will also want to return the
> view-key after indexing the value, or other permutations. If it's just
> the view row (key and value, as returned from a standard view query),
> or the whole document, then any code which is designed to work with
> standard CouchDB queries will be able to consume fulltext results as
> well.
Yes, document or view seams a bit simpler.
>
> Can't wait to play with it.
>
Thanks, but I am not working that fast, I do this after work hours, so time is
limited.
Have fun
Søren
> Chris
--
Søren Hilmer, M.Sc., M.Crypt.
wideTrail Phone: +45 25481225
Pilevænget 41 Email: sh@widetrail.dk
DK-8961 Allingåbro Web: www.widetrail.dk
Re: indexing design document
Posted by Chris Anderson <jc...@mfdz.com>.
On Sat, Mar 29, 2008 at 3:40 PM, Søren Hilmer <sh...@widetrail.dk> wrote:
> Have I missed something?
> I am trying to put the below design document into couch, but it complaints
> with an error saying: Bad special document member: _fulltext_options
>
> Is _fulltext_options something that needs to be added into couch itself? If so
> I have missed that requirement in our discussion.
>
> {
> "_id":"_design/fulltextsearch",
> "_rev":"123",
> "_fulltext_options": {
> "views": {
> "names" : {"index":"view-value", "return":"document"},
> "cities": {"index":"view-key", "return":"view-value"}
> }
> }
> }
>
> Have fun
> Søren
>
Søren,
It's awesome that you are digging into this! I was thinking about the
fulltext_options schema, and it seems it could be simplified a little
by restricting the options for the "return" value to either "document"
or "view". Otherwise surely people will also want to return the
view-key after indexing the value, or other permutations. If it's just
the view row (key and value, as returned from a standard view query),
or the whole document, then any code which is designed to work with
standard CouchDB queries will be able to consume fulltext results as
well.
Can't wait to play with it.
Chris
--
Chris Anderson
http://jchris.mfdz.com