[Sugar-devel] get list of titles in the datastore?

Aleksey Lim alsroot at member.fsf.org
Tue Dec 14 06:07:42 EST 2010


On Tue, Dec 14, 2010 at 11:04:33AM +0000, Aleksey Lim wrote:
> On Mon, Dec 13, 2010 at 05:29:04PM -0500, Erik Blankinship wrote:
> > As a note..  the function find with a { "query":my_search_string } tokenizes
> > both my_search_string and the datastore entries on white space.  The
> > function returns true on any combination.
> > 
> > Journal Entries
> > Goo Bar
> > Goo Bee
> > 
> > datastore_entries, num_entries = datastore.find( {'query':'goo pretzel'} )
> > print( num_entries )
> > 2
> > 
> > This is a little unexpected.  What is the expected use case for this
> > implementation?
> 
> 'query' is intended for arbitrary text search

I mean you can use search operators
http://xapian.org/docs/queryparser.html

> (within all journal
> metadata items where it makes sense), precise search works only for terms
> that were already mentioned here (uid, activity, etc.).
> 
> > 
> > 
> > 
> > On Sat, Dec 4, 2010 at 6:53 AM, Bert Freudenberg <bert at freudenbergs.de>wrote:
> > 
> > > This limitation was already documented here:
> > >
> > >
> > > http://wiki.sugarlabs.org/go/Development_Team/Low-level_Activity_API#Querying
> > >
> > > To my knowledge that page is reasonably up-to-date. Please correct it if
> > > I'm wrong ;)
> > >
> > > - Bert -
> > >
> > > On 04.12.2010, at 04:03, Erik Blankinship wrote:
> > >
> > > from #sugar...
> > >
> > > *alsroot *: try datastore.find({'query':'coolthings'})
> > >
> > > *alsroot*: for now, only uid, activity, activity_id, mime_type and keep
> > > search term are supported
> > >
> > > On Fri, Dec 3, 2010 at 4:49 PM, Erik Blankinship <erikb at mediamods.com>wrote:
> > >
> > >> I tried using this bit of code to get a list of items in the journal by
> > >> their title, but it is returning everything in the journal!
> > >>
> > >> http://bit.ly/fjgpJr
> > >>
> > >> ds_objects, num_objects = datastore.find({'title':'file1.txt'})
> > >>
> > >>
> > >> Any suggestions?
> > >>
> > >>
> > > _______________________________________________
> > > Sugar-devel mailing list
> > > Sugar-devel at lists.sugarlabs.org
> > > http://lists.sugarlabs.org/listinfo/sugar-devel
> > >
> > >
> > >
> > > _______________________________________________
> > > Sugar-devel mailing list
> > > Sugar-devel at lists.sugarlabs.org
> > > http://lists.sugarlabs.org/listinfo/sugar-devel
> > >
> > >
> 
> > _______________________________________________
> > Sugar-devel mailing list
> > Sugar-devel at lists.sugarlabs.org
> > http://lists.sugarlabs.org/listinfo/sugar-devel
> 
> 
> -- 
> Aleksey

-- 
Aleksey


More information about the Sugar-devel mailing list