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



On Thu, 2012-10-04 at 14:32 +0200, Carlos Garnacho wrote:
Hey,

On jue, 2012-10-04 at 07:41 -0400, Adam Tauno Williams wrote:
On Thu, 2012-10-04 at 12:34 +0100, Martyn Russell wrote:
On 04/10/12 12:24, Adam Tauno Williams wrote:
On Thu, 2012-10-04 at 10:54 +0100, Martyn Russell wrote:
On 04/10/12 09:17, Ivan Frade wrote:
   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 ;)
I should add, you can use:
    tracker-control -m $MIME
or
    tracker-control --reindex-mime-type=$MIME
If you change the rules file to note have to reindex all content again.

awilliam linux-nysu:~>
cat /usr/share/tracker/extract-rules/90-text-generic.rule
[ExtractorRule]
ModulePath=/usr/lib64/tracker-0.14/extract-modules/libextract-text.so
MimeTypes=text/*;application/php
awilliam linux-nysu:~> tracker-control
--reindex-mime-type="application/php"
Reindexing mime types was successful
I'd like to point out that the mimetype is application/x-php, not
application/php

Ah, my bad.

sudo vi /usr/share/tracker/extract-rules/90-text-generic.rule

cat /usr/share/tracker/extract-rules/90-text-generic.rule
[ExtractorRule]
ModulePath=/usr/lib64/tracker-0.14/extract-modules/libextract-text.so
MimeTypes=text/*;application/x-php;

tracker-control --reindex-mime-type="application/x-php"
Reindexing mime types was successful

touch /home/awilliam/Documents/Development/PHP/jsonRPCClient.php

tracker-control says filesystem miner is idle

tracker-search Vaccaro

No result.




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