[GRLUG] gnome tracker issue
Adam Tauno Williams
awilliam at whitemice.org
Thu Oct 4 05:31:13 EDT 2012
On Wed, 2012-10-03 at 20:31 -0400, Eric Beversluis wrote:
> On Wed, 2012-10-03 at 18:14 -0400, Adam Tauno Williams wrote:
> > On Wed, 2012-10-03 at 18:03 -0400, Eric Beversluis wrote:
> > > It seems from some stuff on line that in fact tracker does not
> > > index .php files.
> > They at least make it into the index. It indexes other types of code
> > files.
> > awilliam at linux-nysu:~> tracker-search jsonRPCClient
> > Results:
> > file:///home/awilliam/Documents/Development/PHP/jsonRPCClient.php
> > file:///home/awilliam/Documents/Organizations/MI/OGo/CRM%20&%
> > 20Hedera/TireSale/tiresale.py
> > file:///home/awilliam/Documents/Works/Coils.MD/snurtle-code/build/lib/snurtle/jsonrpc.py file:///home/awilliam/Documents/Works/Coils.MD/snurtle-code/build/lib/snurtle/rpcclient.py
> > ...
The root the of the issue here is that there is no extractor for PHP
file types; in Tracker an extractor exists for each file types and
extracts the information from the file [ODT, DOCX, PDF, TXT, etc...] to
be added to the index. Extractors correspond to MIME types and the MIME
type of a PHP file is, for some queer historical reason,
"application/x-php". Whereas Python files have a MIME type of
"text/x-python" so if there isn't an extractor for "text/x-python" it
falls back to extracting with "text/*". Most code files are treated as
text files: "text/x-c", "text/x-c++", "text/x-java", "text/js", etc...
But PHP is "application/*" for which there is, obviously, not default
extractor.
PHP developers, typically, being lower-case-d developers probably aren't
going to write an extractor [which would be done in C].
You can try telling Tracker's text extractor that it can extract PHP
files by editing /usr/share/tracker/extract-rules/90-text-generic.rule
and changing the Mimetypes directive from "text/*" to
"text/*;application.php;". And then restarting tracker - logging in and
out would probably do that. Then just touch the PHP files, when the
tracker miner becomes idle again [tracker-control] check one of the PHP
files using tracker-info.
More information about the grlug
mailing list