Places query syntax

Discussion about official Mozilla Firefox builds
Locked
Oropher
Posts: 346
Joined: September 26th, 2007, 7:12 pm

Post by Oropher »

Korou wrote:Is the URI query broken? I'm trying to use it and it doesn't seem to be working. For example, I want to display recent topics I've visited from my forum and am using place:queryType=0&sort=4&maxResults=10&domain=forums.normlife.com&uri=place:queryType=0&sort=4&maxResults=10&domain=forums.normlife.com&uri=viewtopic.php. It ends up showing pages that do not have "viewtopic.php" in them. Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9pre) Gecko/2008060104 Minefield/3.0pre; Mac OS X 10.5.3

I'm going to guess that the query you have is actually

Code: Select all

place:queryType=0&sort=4&maxResults=10&domain=forums.normlife.com&uri=viewtopic.php

I've never actually used the 'uri' parameter though... I'll have to look into it.
User avatar
Max Karl Ernst
Posts: 107
Joined: February 5th, 2008, 3:43 am

Post by Max Karl Ernst »

@Korou

You probably want to try using "terms" instead of uri. So it would be "terms=viewtopic.php".

I haven't tested uri either, and it probably doesn't work in the way "match this string with any part of uri" but like "match this uri to uri" meaning your uri has to be something like http://blah.blah.com/blahblah.
So it might work if you put something like http://forums.normlife.com/viewtopic.php for uri, haven't tried it tho. :)
User avatar
Korou
Posts: 82
Joined: January 20th, 2004, 5:31 pm

Post by Korou »

Oropher wrote:I'm going to guess that the query you have is actually

Code: Select all

place:queryType=0&sort=4&maxResults=10&domain=forums.normlife.com&uri=viewtopic.php

I've never actually used the 'uri' parameter though... I'll have to look into it.

Erm…yes, that's actually what I had.

Max Karl Ernst wrote:@Korou

You probably want to try using "terms" instead of uri. So it would be "terms=viewtopic.php".

Yeah, terms works. I'm wondering if uri is somehow attached to domain; like if you have to write the uri directly from the end of the domain…
bomfog
Posts: 455
Joined: November 7th, 2002, 3:22 pm
Location: the palouse, SE. WA, USA

Post by bomfog »

Korou wrote:I'm wondering if uri is somehow attached to domain; like if you have to write the uri directly from the end of the domain…
From nsINavHistoryService.idl
806 /**
807 * Controls the interpretation of 'uri'. When unset (default), the URI will
808 * request an exact match of the specified URI. When set, any history entry
809 * beginning in 'uri' will match. For example "http://bar.com/foo" will match
810 * "http://bar.com/foo" as well as "http://bar.com/foo/baz.gif".
811 */
812 attribute boolean uriIsPrefix;
813
814 /**
815 * This is a URI to match, to, for example, find out every time you visited
816 * a given URI. Use uriIsPrefix to control whether this is an exact match.
817 */
818 attribute nsIURI uri;
819 readonly attribute boolean hasUri;
Sounds like you'd use "...&uriIsPrefix=1&uri=http://forums.normlife.com/viewforum.php" (did I set IsPrefix right?), and leave out the "&domain=" bit. Otherwise you'll just be filtering down to the domain and searching from there.

If your urls were like "...normlife.com/variable_stuff/viewforum..." you'd have to do that, I guess.
twondog22
Posts: 2
Joined: June 22nd, 2008, 1:47 pm

Re: Places query syntax

Post by twondog22 »

I have created several smart folders the "normal/easy" way via searching bookmarks and then saving the search followed by using tags to add more bookmarks to the smart folder......All i want to do is sort them by name....
how can I do this? thanks


edit...never mind ...finally figured out that whole folder id thing....
twondog22
Posts: 2
Joined: June 22nd, 2008, 1:47 pm

Re: Places query syntax

Post by twondog22 »

have no clue if anyone still checks this thread for questions but i have another one i havent been able to figure out.....

to create a smart folder for all tags listed A-Z is simply
place:type=6&sort=17

my question is what do i need to add to the code so that the Bookmarks under each Tag are sorted A-Z?????
....to explain in further detail....when i click the smart folder and then scroll down to the tag "Sports" the listed Bookmarks under sports are not alphabetized ie the 1st one is NFL.com followed by Espn.com

just adding &sort=1 just created the identical smart folder
Oropher
Posts: 346
Joined: September 26th, 2007, 7:12 pm

Re: Places query syntax

Post by Oropher »

twondog22 wrote:have no clue if anyone still checks this thread for questions but i have another one i havent been able to figure out.....

to create a smart folder for all tags listed A-Z is simply
place:type=6&sort=17

my question is what do i need to add to the code so that the Bookmarks under each Tag are sorted A-Z?????
....to explain in further detail....when i click the smart folder and then scroll down to the tag "Sports" the listed Bookmarks under sports are not alphabetized ie the 1st one is NFL.com followed by Espn.com

just adding &sort=1 just created the identical smart folder

Unfortunately, there's no way to control the inheritance or non-inheritance of sort orders ATM.
robot999
Posts: 2
Joined: June 24th, 2008, 9:36 am

Re: Places query syntax

Post by robot999 »

If there any way to list the bookmarks that have no tags.
User avatar
a;skdjfajf;ak
Posts: 17002
Joined: July 10th, 2004, 8:44 am

Re: Places query syntax

Post by a;skdjfajf;ak »

robot999 wrote:If there any way to list the bookmarks that have no tags.


Open the LIbrary: Bookmarks->Organizer
View->columns: add the column to show tags
A quick scan thru the listing of your bookmarks in the right pane will now in the 'tags column' those bookmarks that are 'tagged'
robot999
Posts: 2
Joined: June 24th, 2008, 9:36 am

Re: Places query syntax

Post by robot999 »

Littlemutt wrote:
robot999 wrote:If there any way to list the bookmarks that have no tags.


Open the LIbrary: Bookmarks->Organizer
View->columns: add the column to show tags
A quick scan thru the listing of your bookmarks in the right pane will now in the 'tags column' those bookmarks that are 'tagged'

Thanks. But I wish to have a smart folder just like the UNFILED_BOOKMARKS. So I need only three bookmark folders in my firefox pannel, a most used one, a tagged one which holds the tagged bookmarks and a no-taged one which holds the recently added or temporary bookmarks.
heavy_mental
Posts: 1
Joined: June 27th, 2008, 1:58 am

Re: Places query syntax

Post by heavy_mental »

Hello,

Is it possible to make results as URLs instead titles?
Oropher
Posts: 346
Joined: September 26th, 2007, 7:12 pm

Re: Places query syntax

Post by Oropher »

heavy_mental wrote:Hello,

Is it possible to make results as URLs instead titles?

Sure, if you want to make an extension that uses the Places API. But you can't do it with the 'place:' uris talked about in this thread. They're just a shortcut of sorts - a quick way to display the page title with the url and metadata attached.
shil88
Posts: 5
Joined: July 3rd, 2008, 7:54 pm

Re: Places query syntax

Post by shil88 »

how can i join multiple tags in one folder, i.e. having all the bookmarks that have both the "cool" and "firefox" tags
Oropher
Posts: 346
Joined: September 26th, 2007, 7:12 pm

Re: Places query syntax

Post by Oropher »

shil88 wrote:how can i join multiple tags in one folder, i.e. having all the bookmarks that have both the "cool" and "firefox" tags

Far as I know, it's not possible to do an AND query for multiple tags at the moment. You can include several 'terms=' parameters, but that ends up ORing the terms together.
shil88
Posts: 5
Joined: July 3rd, 2008, 7:54 pm

Re: Places query syntax

Post by shil88 »

Oropher wrote:Far as I know, it's not possible to do an AND query for multiple tags at the moment. You can include several 'terms=' parameters, but that ends up ORing the terms together.


this makes the tags rather limited, why introduce the concept if there's already something similar (keywords)

i hope they update the api soon to make for more complex queries
Locked