2013-06-19 1 views
0

나는 내 조직에서 solr을 사용하기 위해 노력하고 있습니다. tomcat 6에 멀티 코어 solr 3.6으로 설정되었습니다.레코드를 반환하지 않는 solr 쿼리를 디버깅하는 방법

지금까지 필자는 우리 스키마의 특정 필드를 받아들이도록 예제 schema.xml을 수정했습니다. 레코드는 문제가되지 않으며 모든 레코드 (?q=*:*)에 대한 쿼리를 실행하면 모든 것을 반환합니다. 그러나 레코드에있는 특정 검색어 (예 : ?q=green 또는 ?q=product_description:green)를 쿼리하면 결과가 표시되지 않습니다. 내가 ipod_video.xml 또는 ipod_other.xml 같은 기본 예제 문서의 일부를 삽입하면 있지만, 그 기록은 그들을 위해 그들에 indexed=true으로 정의되는 새로운 필드 (예 : ?q=ipod 또는 ?q=video)

전체를 검색하면 올 않는다 그래서 우리가 질의를하면 왜 우리 자신의 기록이 전혀 올라 오지 않는지 확신 할 수 없습니다.

어떤 아이디어가이 문제를 디버깅하는 방법?

업데이트 - schema.xml 및 solrconfig.xml 세부 정보가 추가되었습니다. solrconfig.xml에서 요청 처리기 여기

<fields> 
<field name="search_title" type="text_general" indexed="true" stored="true" multiValued="true"/> 
<field name="search_prefix" type="string" indexed="true" stored="true" multiValued="true"/> 
<field name="search_description" type="text_general" indexed="true" stored="true" multiValued="true"/> 
<field name="search_content" type="text_general" indexed="true" stored="true" multiValued="true"/> 
<field name="product_date" type="date" indexed="true" stored="true" multiValued="true"/> 
<field name="product_thumbnail" type="string" indexed="true" stored="true" multiValued="true"/> 

<field name="product_type" type="string" indexed="true" stored="true" multiValued="false"/> 
<field name="product_updatepricefunction" type="string" indexed="true" stored="true" multiValued="true"/> 
<field name="tagids" type="string" indexed="true" stored="true" multiValued="true"/> 
<field name="tagid" type="string" indexed="true" stored="true" multiValued="true"/> 
<dynamicField name="*_tag" type="string" indexed="true" stored="true"/> 
<field name="event_id" type="string" indexed="true" stored="true" multiValued="true"/> 
<field name="activity_id" type="string" indexed="true" stored="true" multiValued="true"/> 
<field name="activity_function_code" type="string" indexed="true" stored="true" multiValued="true"/> 
<field name="search_room" type="string" indexed="true" stored="true" multiValued="true"/> 
<field name="weekday" type="string" indexed="true" stored="true" multiValued="true"/> 
<field name="activity_weekday" type="string" indexed="true" stored="true" multiValued="true"/> 
<field name="activity_begindate" type="string" indexed="true" stored="true" multiValued="true"/> 
<field name="activity_begintime" type="string" indexed="true" stored="true" multiValued="true"/> 
<field name="activity_endtime" type="string" indexed="true" stored="true" multiValued="true"/> 
<field name="audience" type="text_general" indexed="true" stored="true" multiValued="true"/> 
<field name="format" type="text_general" indexed="true" stored="true" multiValued="true"/> 
<field name="publish_date" type="date" indexed="true" stored="true" multiValued="true"/> 
<field name="isbn" type="string" indexed="true" stored="true" multiValued="true" /> 
<field name="product_code" type="string" indexed="true" stored="true" required="true"/> 
</fields> 

<uniqueKey>product_code</uniqueKey> 

된다 :

의 schema.xml 사실상 SOLR 3.6 그러나이 추가 된 필드와 함께 제공되는 기본의 schema.xml과 동일합니다 :

<requestHandler name="/select" class="solr.SearchHandler"> 
<!-- default values for query parameters can be specified, these 
    will be overridden by parameters in the request 
    --> 
<lst name="defaults"> 
    <str name="echoParams">explicit</str> 
    <int name="rows">10</int> 
    <str name="df">text</str> 
</lst> 
<!-- In addition to defaults, "appends" params can be specified 
    to identify values which should be appended to the list of 
    multi-val params from the query (or the existing "defaults"). 
    --> 
<!-- In this example, the param "fq=instock:true" would be appended to 
    any query time fq params the user may specify, as a mechanism for 
    partitioning the index, independent of any user selected filtering 
    that may also be desired (perhaps as a result of faceted searching). 

    NOTE: there is *absolutely* nothing a client can do to prevent these 
    "appends" values from being used, so don't use this mechanism 
    unless you are sure you always want it. 
    --> 
<!-- 
    <lst name="appends"> 
    <str name="fq">inStock:true</str> 
    </lst> 
    --> 
<!-- "invariants" are a way of letting the Solr maintainer lock down 
    the options available to Solr clients. Any params values 
    specified here are used regardless of what values may be specified 
    in either the query, the "defaults", or the "appends" params. 

    In this example, the facet.field and facet.query params would 
    be fixed, limiting the facets clients can use. Faceting is 
    not turned on by default - but if the client does specify 
    facet=true in the request, these are the only facets they 
    will be able to see counts for; regardless of what other 
    facet.field or facet.query params they may specify. 

    NOTE: there is *absolutely* nothing a client can do to prevent these 
    "invariants" values from being used, so don't use this mechanism 
    unless you are sure you always want it. 
    --> 
<!-- 
    <lst name="invariants"> 
    <str name="facet.field">cat</str> 
    <str name="facet.field">manu_exact</str> 
    <str name="facet.query">price:[* TO 500]</str> 
    <str name="facet.query">price:[500 TO *]</str> 
    </lst> 
    --> 
<!-- If the default list of SearchComponents is not desired, that 
    list can either be overridden completely, or components can be 
    prepended or appended to the default list. (see below) 
    --> 
<!-- 
    <arr name="components"> 
    <str>nameOfCustomComponent1</str> 
    <str>nameOfCustomComponent2</str> 
    </arr> 
    --> 
</requestHandler> 
+0

schema.xml 파일을 도와 줄 수 있습니까? – JHS

+0

죄송합니다. 무슨 뜻인지 이해하지 못 하시겠습니까? – roy

+0

schema.xml 파일과 solr-config.xml 파일에서/select requestHandler를보고 싶습니다. – JHS

답변

1

q=<search phrase>은 언급 된 기본 필드에서 검색한다는 것을 의미합니다. 그러나 기본 필드를 지정하지 않았거나 기본 필드 이외의 특정 필드를 쿼리하려는 경우 Solr에 q=<fieldname>:<search phrase>을 쿼리해야합니다.

Solr은 요구 사항에 따라 문서를 색인화하는 데 사용할 수있는 다양한 분석기를 제공합니다. 보세요 here.

첫번째 질문 업데이트 후

편집 - /selectrequestHandler는 기본적으로 필드 text을 가지고 있으며, 당신은 텍스트라는 이름의 필드가없는 파일의 schema.xml. 2

- 당신의 schema.xml 파일에서이 필드 search_title, search_description, search_content, audienceformat은 토큰 화 유형 text_general의이다. 다른 모든 필드는 String입니다.

세 번째 - String 유형의 필드를 검색하려면 정확한 검색 구문이 필요하거나 와일드 카드를 사용해야합니다. 예 : 문서의 값이 필드에 green 인 경우 q=product_type:green 쿼리는 검색 결과에 문서를 제공합니다. 그러나 green color 값이 product_type 필드에 있으면 q=product_type:green 쿼리는 결과를 제공하지 않습니다. 그러나 쿼리 q=product_type:green*은 검색 결과에 문서를 제공합니다.

나는 Solr에 대한 기본적인 정보와 시작을 ​​제공했다고 생각합니다. 이제 위에서 준비한 링크를 읽어야합니다.

+0

미안하지만,이 또한 우리 자신의 기록 ('q = : '사용)에서 작동하지 않는다고 덧붙여 야했습니다. 이 질문을 명확히하기 위해 원래 질문을 업데이트했습니다. – roy

+0

schema.xml 파일과 solr-config.xml 파일에서/select requestHandler를보고 싶습니다. – JHS

+0

죄송합니다. 불행히도, : <검색 구문>은 일부 필드에 대해서는 작동하지만 전부는 아닙니다. – roy

관련 문제