การลบคำหยุดดัชนี Solr ดูเหมือนจะไม่ทำงาน

ฉันต้องการลบคำหยุดออกจากดัชนีของฉันในระหว่างการจัดทำดัชนีและการสืบค้น แต่คำใน stopwords.txt ดูเหมือนจะไม่ถูกลบออกจากดัชนีของฉัน (ฉันยังคงสามารถใช้คำเหล่านี้ในการสืบค้นและได้รับผลลัพธ์ที่ตรงกับคำเหล่านั้น)

นี่คือ schema.xml ของฉัน:

    <fieldType name="text" class="solr.TextField"         positionIncrementGap="100">
          <analyzer type="index">
            <tokenizer class="solr.StandardTokenizerFactory"/>
            <!-- in this example, we will only use synonyms at query time
            <filter class="solr.SynonymFilterFactory"         synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
            -->
            <filter class="solr.LowerCaseFilterFactory"/>
            <filter class="solr.StopFilterFactory"         ignoreCase="true"         words="stopwords.txt" />
            <filter class="solr.WordDelimiterFilterFactory"         generateWordParts="1" generateNumberParts="1" catenateWords="1"         catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>        
            <filter class="solr.KeywordMarkerFilterFactory"         protected="protwords.txt"/>
            <filter class="solr.KStemFilterFactory"/>
            <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
          </analyzer>
          <analyzer type="query">
            <tokenizer class="solr.StandardTokenizerFactory"/>
            <filter class="solr.SynonymFilterFactory"         synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
            <filter class="solr.LowerCaseFilterFactory"/>
            <filter class="solr.StopFilterFactory" ignoreCase="true"         words="stopwords.txt" />
            <filter class="solr.WordDelimiterFilterFactory"         generateWordParts="1" generateNumberParts="1" catenateWords="0"         catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>        
            <filter class="solr.KeywordMarkerFilterFactory"         protected="protwords.txt"/>
            <filter class="solr.KStemFilterFactory"/>
            <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
          </analyzer>
        </fieldType>
      <field name="_version_" type="long" indexed="true" stored="true"/>
      <field name="id" type="string" indexed="true" stored="true"         required="true" multiValued="false" />
      <field name="post_content" type="text" indexed="true"         stored="true"/>
      <field name="post_title" type="text" indexed="true" stored="true"/>
      <field name="post_date" type="date" indexed="true" stored="true"/>
      <field name="_text_" type="text" indexed="true"         stored="false"          multiValued="true" termVectors="true"                 termPositions="true" termOffsets="true"/>

ฉันใช้ Solr 6.0

ขอบคุณสำหรับคำแนะนำใด ๆ

ซาบีน


person S.Berg    schedule 29.08.2016    source แหล่งที่มา
comment
มีไฟล์ชื่อเดียวกันนี้หรือไม่? คุณมีคำเหล่านั้นในไฟล์ stopwords.txt หรือไม่?   -  person Abhijit Bashetti    schedule 29.08.2016
comment
ขออภัยที่รบกวนชุมชน - ฉันแก้ไขปัญหาด้วยตัวเองโดยเพิ่ม format=snowball   -  person S.Berg    schedule 29.08.2016
comment
ไม่มีปัญหา...มันอาจช่วยคนอื่นได้... :)   -  person Abhijit Bashetti    schedule 29.08.2016


คำตอบ (1)


ตามค่าเริ่มต้น ไฟล์ stopwords.txt จะไม่มีคำหยุดใดๆ อยู่ในนั้น

คุณสามารถตรวจสอบสิ่งเดียวกันได้ใน configSet ที่กำหนดโดย Solr

แต่ถ้าคุณตรวจสอบโฟลเดอร์ conf/lang คุณจะพบไฟล์คำหยุดมากมาย

คุณสามารถใช้สิ่งใดก็ตามที่เหมาะกับคุณตามภาษาของคุณ

เพื่อวัตถุประสงค์ในการทดสอบ คุณสามารถคัดลอกคำหยุดจากไฟล์ stopwords_en.txt และวางลงในไฟล์ stopward.txt ในเส้นทาง configsets/basic_configs/conf/ configset ที่นี่อาจแตกต่างกันสำหรับคุณ ขึ้นอยู่กับอันที่คุณใช้

person Abhijit Bashetti    schedule 29.08.2016