저장된 검색 파일 형식

Windows Vista 이상에서 사용자는 쿼리를 Windows 검색 하위 시스템에 사용할 수 있는 형식으로 저장하는 XML 파일에 의해 생성되는 검색 폴더로 검색을 저장할 수 있습니다. 이 항목에서는 파일 형식(*.search-ms)에 대해 설명하고 다음 섹션을 포함합니다.

저장된 검색 개요

사용자는 검색 쿼리를 검색 폴더로 저장할 수 있습니다. 이 폴더는 Windows Explorer 검색 폴더 아래에 표시되는 가상 폴더입니다. 검색 폴더를 열면 저장된 검색이 실행되고 최신 결과가 표시됩니다. 저장된 검색 파일은 검색 대상, 검색 위치 및 결과를 표시하는 방법을 지정하여 Windows Search가 작동할 수 있는 형식으로 쿼리를 저장합니다.

저장된 검색은 %userprofile%\Search 폴더의 XML 파일(*.search-ms)에서 생성됩니다. 데이터는 XML 파일의 세 가지 기본 요소로 나뉩니다.

  • <viewInfo> 는 프레젠테이션 정보를 지정합니다.
  • <쿼리> 가 지정합니다(쿼리 정보 검색
  • <속성> 은 *.search-ms 파일 자체의 속성을 지정합니다.

다음 예제에서는 저장된 검색 파일의 상위 수준 구조를 보여 냅니다.

<?xml version="1.0"?>
<persistedQuery version="1.0">

    <viewInfo ...>
        ...
    </viewInfo>

    <query>
        ...
    </query>

    <properties>
        ...
    </properties>

</persistedQuery>

<viewInfo> 요소

<viewInfo> 요소는 결과가 최종 사용자에게 표시되는 방법을 지정합니다. 다음 예제에서는 요소의 구조를 보여줍니다.

...
    <viewInfo viewMode=""
              iconSize=""
              stackIconSize=""
              autoListFlags=""
              folderFlags=""
              taskFlags=""
              displayName="">

        <visibleColumns>
            <column viewField=""/>
        </visibleColumns>

        <frequentlyUsedColumns>
            <column viewField= ""/>
        </frequentlyUsedColumns>

        <columnChooserColumns >
            <column viewField=""/>
        </columnChooserColumns >

        <groupBy viewField=""
                 direction=""/>

        <stackList>
            <stack viewField=""/>
        </stackList>

        <sortList>
            <sort viewField=""
                  direction=""/>
        </sortList>
    </viewInfo>
...

<viewInfo> 특성

다음 표에서는 viewInfo> 요소의 <특성을 설명합니다.

attribute Description
viewMode 폴더 보기를 지정합니다. 세부 정보 | 아이콘 | 타일
iconSize 스택되지 않을 때 항목에 대한 아이콘 및 축소판 그림의 기본 크기를 제어합니다. 16에서 256 사이의 정수
stackIconSize 내부 전용입니다. 사용하지 마십시오. 해당 없음
displayName 내부 전용입니다. 사용하지 마십시오. 해당 없음
autoListFlags 내부 전용입니다. 사용하지 마십시오. 해당 없음
folderFlags 내부 전용입니다. 사용하지 마십시오. 해당 없음
taskFlags 내부 전용입니다. 사용하지 마십시오. 해당 없음

<viewInfo> 자식 요소

viewInfo> 요소의 <자식 요소는 Windows Explorer 검색 결과에 표시되는 열과 결과를 그룹화하고 정렬하는 방법을 지정합니다. 각 자식 요소에는 시스템 속성의 정식 이름(예: System.DisplayName)으로 식별되는 정렬된 열 집합이 포함됩니다. 저장된 검색 파일에 정의되지 않은 경우 검색 결과에 표시되는 파일 형식에 적합한 기본 열 집합이 표시됩니다.

요소 Description
visibleColumns 결과 뷰에 표시할 열의 순서가 지정된 목록을 지정합니다. 사용자는 이 목록을 변경할 수 있습니다. 모든 시스템 속성입니다.
frequentlyUsedColumns 내부 전용입니다. 사용하지 마십시오. 해당 없음
columnChooserColumns 내부 전용입니다. 사용하지 마십시오. 해당 없음
Groupby 결과를 그룹화할 단일 시스템 속성을 지정합니다. 사용자는 이 값을 변경할 수 있습니다. 모든 시스템 속성입니다.
sortList 결과를 정렬할 열의 순서가 지정된 목록을 지정합니다. 최대 4개의 시스템 속성. 사용자는 이 목록을 변경할 수 있습니다.
stackList 내부 전용입니다. 사용하지 마십시오. 해당 없음

<query> 요소

<쿼리> 요소는 결과를 쿼리하는 방법을 정의하는 특성을 지정합니다. 다음 예제에서는 요소의 구조를 보여줍니다.

...
    <query>
        <providers>
            <provider clsid=""/>    <!-- Do not use -->
        </providers>

        <subQueries>
            <subQuery path=""/>           <!-- Do not use -->
            <subQuery knownSearch=""/>    <!-- Do not use -->
        </subQueries>

        <scope>
            <include path=""        nonRecursive=""/>   <!-- [path of location to include] -->
            <include knownFolder="" nonRecursive=""/>   <!-- Known folder ID  -->
            <exclude path=""        nonRecursive=""/>   <!-- [path of location to exclude] -->
            <exclude knownFolder="" nonRecursive=""/>   <!-- Known folder ID  -->
        </scope>

        <kindList>
            <kind name=""/>     <!-- Kind value -->
        </kindList>

        <conditions>
            <condition type="" ...>     <!-- andCondition | orCondition | notCondition | leafCondition -->
                <attributes>
                    <attribute attributeID="" .../> <!-- Do not use -->
                </attributes>
            </condition>
        </conditions>
    </query>
...

<자식 요소 쿼리>

다음 표에서는 scope 요소의 자식 요소에 <대해> 설명합니다.

요소 Description
providers 내부 전용입니다. 사용하지 마십시오. 해당 없음
하위 쿼리가 내부 전용입니다. 사용하지 마십시오. 해당 없음
Scope 검색에 포함하거나 제외할 위치를 식별합니다. 포함하거나 제외할 위치의 경로 또는 알려진 폴더 ID 입니다. 이 요소는 검색에 자식 경로(단순 검색 또는 심층 검색)를 포함/제외할지 여부를 지정할 수도 있습니다.
kindList 검색할 파일의 종류를 식별합니다. 모든 System.Kind 값입니다.
조건 결과를 필터링하는 규칙을 지정합니다. 예를 들어 결과는 또는 특정 사용자가 보낸 전자 메일로 제한될 수 있습니다. andCondition, orCondition, notCondition, leafCondition.

< > scope 요소

<scope> 요소는 검색에서 포함하거나 제외할 위치를 식별합니다. <scope> 요소에는 하나 이상의 <자>식 요소와 0개 이상의 <제외> 요소가 포함되어야 합니다. 위치는 경로(환경 변수가 지원됨) 또는 알려진 폴더 식별자로 지정할 수 있습니다. 또한 이러한 각 위치는 nonRecursive를 "true" 또는 "false"(기본값은 재귀적)로 설정하여 깊거나 단순하게 검색되도록 지정할 수 있습니다. 제외 요소를 지정하여 포함된 위치 목록의 일부를 제외할 수 있습니다.

다음은 문서 특수 폴더를 <> 검색하지만 자식, "E:" 볼륨 및 자식은 검색하지 않지만 "E:\windows" 디렉터리 또는 해당 자식은 검색하지 않는 scope 요소를 보여줍니다.

...
    <query>
        ...
        <scope>
            <include knownFolder="{FDD39AD0-238F-46AF-ADB4-6C85480369C7}" nonRecursive="true"/>
            <include path="E:\"/>
            <exclude path="E:\Windows" nonRecursive="false"/>
        </scope>
        ...
    </query>
...

<kindList> 요소

이러한 요소는 라이브러리에 표시되어야 하는 항목의 "종류"의 합집합을 정의합니다. 유효한 값은

  • 달력
  • communication
  • contact
  • 문서
  • 이메일
  • feed
  • 폴더
  • 게임
  • instantmessage
  • 저널
  • link
  • 영화
  • music
  • 참고
  • picture
  • 프로그램
  • recordedtv
  • searchfolder
  • task
  • 비디오
  • webhistory
  • 항목
  • other

<conditions> 요소

조건은 검색 결과가 비교되는 필터입니다. 예를 들어 작성자 이름 또는 파일 크기와 같은 특정 조건을 충족하는 결과를 필터링할 수 있습니다. 조건 집합은 논리적 AND, OR 및 NOT 분기가 있는 단일 조건 트리에 기본 제공됩니다.

다음 예제에서는 조건> 요소의 <구조를 보여줍니다.

...
    <query>
        ...
        <conditions>
            <condition type="" ...>
                <attributes>
                    <attribute attributeID="" .../>
                </attributes>
            </condition>
        </conditions>
    </query>
...

조건 유형은 다음 중 하나일 수 있습니다.

형식 Description 사용 가능한 특성
andCondition 둘 이상의 자식 조건 결합 해당 없음
orCondition 두 개 이상의 자식 조건의 분리 해당 없음
notCondition 자식 조건의 부정 해당 없음
leafCondition 속성과 값을 비교합니다. property, propertyType, operator, value, valuetype

leafCondition> 요소의 특성은 <결과가 필터링되는 속성과 값을 식별합니다.

예: <conditions> 요소

다음 예제에서는 John이 작성한 읽지 않은 모든 항목에 대한 결과를 필터링합니다. 즉, System.IsRead 속성은 false이고 System.Author 또는 System.ItemAuthors 속성에 "john" 문자열이 나타납니다.

...
    <query>
        ...
        <conditions>

            <condition type="andCondition">

                <condition type="leafCondition"
                           property="System.IsRead"
                           operator="eq"
                           value="FALSE"/>

                <condition type="orCondition">

                    <condition type="leafCondition"
                               property="System.Author"
                               propertyType="string"
                               operator="wordmatch"
                               value="John"
                               valueType="System.StructuredQueryType.String"/>

                    <condition type="leafCondition"
                               property="System.ItemAuthors"
                               propertyType="string"
                               operator="wordmatch"
                               value="John"
                               valueType="System.StructuredQueryType.String"/>

                </condition>

            </condition>

        </conditions>

    </query>
...

<properties> 요소

<properties> 요소는 저장된 검색 자체의 속성을 설명합니다. 저장된 검색 파일은 작성자>, 종류>, <<설명> 및 태그의 <네 가지 속성을 <지원합니다>. 내부 전용입니다.

search-ms 파일 형식의 전체 사양

다음은 저장된 검색 파일에 대한 전체 XML의 예입니다.

<?xml version="1.0"?>

<persistedQuery version="1.0">

    <!-- The viewInfo section defines how results are displayed to the end user -->
    <viewInfo viewMode=""       <!-- details | icons | tiles -->
              iconSize=""       <!-- Integer -->
              stackIconSize=""  <!-- Do not use -->
              displayName=""    <!-- Do not use -->
              folderFlags=""    <!-- Do not use -->
              taskFlags=""      <!-- Do not use -->
              autoListFlags=""> <!-- Do not use -->

        <visibleColumns>
            <column viewField=""/>  <!-- System.[propertyname] -->
        </visibleColumns>

        <frequentlyUsedColumns>
            <column viewField= ""/> <!-- Do not use -->
        </frequentlyUsedColumns>

        <columnChooserColumns >
            <column viewField=""/>  <!-- Do not use -->
        </columnChooserColumns >

        <groupBy viewField=""       <!-- System.[propertyname] -->
                 direction=""/>     <!-- ascending | descending -->

        <stackList>
            <stack viewField=""/>   <!-- Do not use -->
        </stackList>

        <sortList>
            <sort viewField=""      <!-- System.[propertyname] -->
                  direction=""/>    <!-- ascending | descending -->
        </sortList>
    </viewInfo>

    <!-- The query section defines what gets searched (locations, file kinds) -->
    <query>
        <providers>
            <provider clsid=""/>          <!-- Do not use -->
        </providers>

        <subQueries>
            <subQuery path=""/>           <!-- Do not use -->
            <subQuery knownSearch=""/>    <!-- Do not use -->
        </subQueries>

        <scope>
            <include path=""        nonRecursive=""/>   <!-- [path of location to include] -->
            <include knownFolder="" nonRecursive=""/>   <!-- Known folder ID  -->
            <exclude path=""        nonRecursive=""/>   <!-- [path of location to exclude] -->
            <exclude knownFolder="" nonRecursive=""/>   <!-- Known folder ID  -->
        </scope>

        <kindList>
            <kind name=""/>     <!-- Kind value -->
        </kindList>

        <conditions>
            <condition type="" ...>     <!-- andCondition | orCondition | notCondition | leafCondition -->
                <attributes>
                    <attribute attributeID="" .../> <!-- Do not use -->
                </attributes>
            </condition>
        </conditions>
    </query>

    <!-- The properties section identifies properties of the saved search file itself. -->
    <properties>
        ...             <!-- Do not use -->
    </properties>

</persistedQuery>

저장된 검색의 예

다음은 *.search-ms 파일의 예입니다.

최근 Documents.search-ms

<?xml version="1.0"?>
<persistedQuery version="1.0">
    <viewInfo viewMode="details" iconSize="16">
        <sortList>
            <sort viewField="System.DateModified" direction="descending"/>
        </sortList>
    </viewInfo>

    <query>
        <conditions>
            <condition type="leafCondition" valuetype="System.StructuredQueryType.DateTime" property="System.DateModified" operator="imp" value="R00UUUUUUUUZZXD-30NU" propertyType="wstr" />
        </conditions>
        <kindList>
            <kind name="Document"/>
        </kindList>
        <subQueries>
            <subQuery knownSearch="{4f800859-0bd6-4e63-bbdc-38d3b616ca48}"/>
        </subQueries>
    </query>
</persistedQuery>

최근 Music.search-ms

<?xml version="1.0"?>
<persistedQuery version="1.0">
    <viewInfo viewMode="details" iconSize="16">
        <sortList>
            <sort viewField="System.DateModified" direction="descending"/>
        </sortList>
    </viewInfo>

    <query>
        <conditions>
            <condition type="leafCondition" valuetype="System.StructuredQueryType.DateTime" property="System.DateModified" operator="imp" value="R00UUUUUUUUW-1WNNU" propertyType="wstr"/>
        </conditions>
        <kindList>
            <kind name="Music"/>
        </kindList>
        <subQueries>
            <subQuery knownSearch="{4f800859-0bd6-4e63-bbdc-38d3b616ca48}"/>
        </subQueries>
    </query>
</persistedQuery>

최근에 공유한 Me.search-ms

<?xml version="1.0"?>
<persistedQuery version="1.0">
    <viewInfo viewMode="details" iconSize="16">
        <visibleColumns>
            <column viewField="System.ItemNameDisplay"/>
            <column viewField="System.DateModified"/>
            <column viewField="System.Keywords"/>
            <column viewField="System.SharedWith"/>
            <column viewField="System.ItemFolderPathDisplayNarrow"/>
        </visibleColumns>
        <frequentlyUsedColumns>
            <column viewField="System.Author"/>
            <column viewField="System.Kind"/>
            <column viewField="System.Size"/>
            <column viewField="System.Title"/>
            <column viewField="System.Rating"/>
        </frequentlyUsedColumns>
        <sortList>
            <sort viewField="System.SharedWith" direction="descending"/>
        </sortList>
    </viewInfo>

    <query>
        <conditions>
            <condition type="andCondition">
                <condition type="leafCondition" property="System.IsShared" operator="eq" value="true"/>
                <condition type="leafCondition" property="System.FileOwner" operator="eq" value="[Me]"/>
            </condition>
        </conditions>
        <kindList>
            <kind name="item"/>
        </kindList>
        <scope>
            <include knownFolder="{5E6C858F-0E22-4760-9AFE-EA3317B67173}"/>
            <include knownFolder="{DFDF76A2-C82A-4D63-906A-5644AC457385}"/>
        </scope>
    </query>
</persistedQuery>