You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Alok Bhandari <al...@gmail.com> on 2012/07/09 12:41:00 UTC

PathHierarchyTokenizerFactory behavior

Hello,

this is how the field is declared in schema.xml 

<fieldType name="text_path" class="solr.TextField" stored="true"
indexed="true" positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.PathHierarchyTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
      </analyzer>
</fieldType>

when I query for this filed with input
"M:/Users/User/AppData/Local/test/abc.txt" .
It searches for documents containing any of the token generated M,Users,
User .... etc.but I want to search for exact file with the given input as a
value. Please let me know how I can achieve that. I am using solr 3.6.thanks

--
View this message in context: http://lucene.472066.n3.nabble.com/PathHierarchyTokenizerFactory-behavior-tp3993839.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: PathHierarchyTokenizerFactory behavior

Posted by Chris Hostetter <ho...@fucit.org>.
: Modifying the field definition to 

Alok: thanks for reporting this.  I've opend an issue to improve hte 
example and the docs...

https://issues.apache.org/jira/browse/SOLR-3674


-Hoss

Re: PathHierarchyTokenizerFactory behavior

Posted by Alok Bhandari <al...@gmail.com>.

Modifying the field definition to 

<fieldType name="text_path" class="solr.TextField" stored="true"
indexed="true" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.PathHierarchyTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory" />
      </analyzer>
         <analyzer type="query">
              <tokenizer class="solr.KeywordTokenizerFactory"/>
            <filter class="solr.LowerCaseFilterFactory" />
     </analyzer>
</fieldType>

solves the purpose . got it from the link 

http://stackoverflow.com/questions/6920506/solr-pathhierarchytokenizerfactory-facet-query

--
View this message in context: http://lucene.472066.n3.nabble.com/PathHierarchyTokenizerFactory-behavior-tp3993839p3994154.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: PathHierarchyTokenizerFactory behavior

Posted by Alok Bhandari <al...@gmail.com>.
Hello Koji,

thanks for reply. yes one way I can try is use copyField with one of the
copy using PathHierarchyTokenizerFactory and the other using
KeywordTokenizerFactory and depending on whether input entered is directory
path or exact file path switch between these 2 fields . thanks

--
View this message in context: http://lucene.472066.n3.nabble.com/PathHierarchyTokenizerFactory-behavior-tp3993839p3993866.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: PathHierarchyTokenizerFactory behavior

Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
(12/07/09 19:41), Alok Bhandari wrote:
> Hello,
>
> this is how the field is declared in schema.xml
>
> <fieldType name="text_path" class="solr.TextField" stored="true"
> indexed="true" positionIncrementGap="100">
>        <analyzer>
>          <tokenizer class="solr.PathHierarchyTokenizerFactory"/>
>          <filter class="solr.LowerCaseFilterFactory" />
>        </analyzer>
> </fieldType>
>
> when I query for this filed with input
> "M:/Users/User/AppData/Local/test/abc.txt" .
> It searches for documents containing any of the token generated M,Users,
> User .... etc.but I want to search for exact file with the given input as a
> value. Please let me know how I can achieve that. I am using solr 3.6.thanks

Can you try KeywordTokenizerFactory instead of PathHierarchyTokenizerFactory?

koji
-- 
http://soleami.com/blog/starting-lab-work.html