Re: [Tracker] search match on substrings



On 04/11/13 12:19, Brian J. Murrell wrote:
On 11/04/2013 03:13 AM, Martyn Russell wrote:

BY and LAW would be separate words, "-" is considered a word gap/space.

Ahh.  Interesting.  So this does work:

$ tracker-search --disable-color -l 1000 "BY LAW"

Not sure without looking at the SPARQL to be honest.

even though it's not displaying the first use of the string "BY-LAW" as
the example content.  Does tracker search typically show the first match
of the search terms as the example text?  IOW, should I interpret that
it's not using the first occurence as the example text to mean that it
did not match the first occurence?

But given that - is a word gap/space, maybe tracker-{search,needle}
should replace characters in query that are considered word gap/space so
that the search terms more closely match what would have been indexed?

In reality, if you're looking for either of those words you want it to find the same bit of text right ...

For numbers, you need to make sure you're indexing numbers. Did you
check that after following Ivan's email?

Ahhh.  Forgot about numbers.  Just enabled that.  Thanks!

:)

A reindex is needed after that.

10-4.

A digression from this thread but is there any way to limit search
results, say to files that are in a specific directory, and/or
subdirectory/tree of a specific dir?

Yep. Something like this does that job:

$ tracker-sparql -q "select nie:url(?p) nie:url(?f) where { ?f a nfo:FileDataObject ; nfo:belongsToContainer ?p ; fts:match 'BY OR LAW'. FILTER(fn:starts-with(nie:url(?p),'file:///home/user/Documents')) } ORDER BY ASC nie:url(?p) LIMIT 5"

But back to this thread, maybe an easier way for me to achieve my goal
is to see what is in the index for any given file.  Is there a way to
query the database for that?  i.e. "show me all of the words indexed for
document file:///foo/bar.pdf"

$ tracker-info /foo/bar.pdf

OR

$ tracker-info $URN

where URN can be urn:uuid:HASH or file:///foo/bar.pdf or the unique identifier in Tracker. Often tracker-search will give you this ID.

For plain text content, you will need to use:

$ tracker-info -c $URN

We don't normally show it because it spams the console with content from the file, naturally :)

--
Regards,
Martyn

Founder & Director @ Lanedo GmbH.
http://www.linkedin.com/in/martynrussell


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]