Re: [Tracker] It doesn't index PHP files



Hi,

 I think python script contents are indexed because the mimetype is
"text/x-python" and it falls back to the "text/*" extractor. PHP files
have the mimetype "application/x-php" and there is no default option
for that.

 This can be solved adding "application/x-php" in the .rules file of
the text extractor (check
/usr/local/share/tracker/extract-rules/90-text-generic.rule and other
rule files in the same folder).

 Note that generic text indexing means that the python code is treated
as plain text, a bunch of words. You could always write an specialized
extractor that takes into account the semantic of the file. For
example ignoring __init__.py files, or import statemens, maybe
ignoring the code and indexing only function names.... depends on what
you want. Same applies to PHP.

 Writing an extractor module is not difficult with some rudiments of
programming in C and we can help via mailing list or IRC. Patches are
welcome ;)

 Regards,

Ivan



On Thu, Oct 4, 2012 at 1:21 AM, Adam Tauno Williams
<awilliam whitemice org> wrote:
A friend said that Tracker does not index the contents of PHP files... i
though nah, no way.  It certainly indexes the contents of my Python
scripts.  But when I went and tried - I can't get a PHP file in the
result except by filename match.

Why doesn't Tracker index the PHP files?   Am I missing something, a
setting, or does it just not have an extractor for PHP?

tracker-0.14.2-26.1.x86_64 openSUSE 12.2 x86_64 GNOME 3.6

### Matches filename?

awilliam 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

#### does not match word found in the header

awilliam linux-nysu:~> tracker-search Vaccaro
Results:

#####  does not match method name in the file

awilliam linux-nysu:~> tracker-search setRPCNotification
Results:



_______________________________________________
tracker-list mailing list
tracker-list gnome org
https://mail.gnome.org/mailman/listinfo/tracker-list



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