查询自定义属性 [英] Querying for custom properties

查看:116
本文介绍了查询自定义属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

致谢.

我添加了一个自定义属性架构,如下所示:

I added a custom property schema as follows:

<?xml version =''1.0''?>
< schema
xmlns:xsi =" xmlns ="; http://schemas.microsoft. com/windows/2006/propertydescription "
schemaVersion =" 1.0">

propertyDescription name ="c360.TestProperty"
formatId ="{4A7594E4-FE14-4F6B-88C8-494EA4B001E9}"".< searchInfo isInvertedIndex ="true" isColumn ="true"; columnIndexType ="OnDisk"/>
.< typeInfo type ="String" isViewable ="true"; isQueryable ="true"; includeInFullTextQuery ="true"; />
.< displayInfo defaultColumnWidth =" 30" />
</propertyDescription>
</propertyDescriptionList>
</schema>

<?xml version="1.0"?>
<schema
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="http://schemas.microsoft.com/windows/2006/propertydescription"
 schemaVersion="1.0">
 <propertyDescriptionList publisher="c360" product="TestProduct">
  <propertyDescription name="c360.TestProperty"
   formatId="{4A7594E4-FE14-4F6B-88C8-494EA4B001E9}"
   propertyId="1">
   <searchInfo isInvertedIndex="true" isColumn="true" columnIndexType="OnDisk"/>
   <labelInfo label="TestProperty_Label" invitationText="TestProperty_InvitationText" />
   <typeInfo type="String" isViewable="true" isQueryable="true" includeInFullTextQuery="true" />
   <displayInfo defaultColumnWidth="30" />
  </propertyDescription>
 </propertyDescriptionList>
</schema>

然后,我更改了过滤器以输出此属性的值. filtdump的片段显示如下:

Then I changed my filter to output the value for this property. filtdump snipped is shown below:

--------------------------------------------------- -----------------------
属性= 4A7594E4-FE14-4F6B-88C8494EA4B001E9 \ 1
idChunk = 1
BreakType = 0(不间断)
Flags(chunkstate)= 0x2(值)
区域设置= 1033(0x409)
-IdChunkSource = 0 -------------------------------------------------- ---------------
类型= 31(0x1f):c360-自定义属性

----------------------------------------------------------------------
                Attribute = 4A7594E4-FE14-4F6B-88C8494EA4B001E9\1
                idChunk = 1
                BreakType = 0 (No Break)
                Flags(chunkstate) = 0x2 (Value)
                Locale = 1033 (0x409)
                IdChunkSource = 0
                cwcStartSource = 0
                cwcLenSource = 0
----------------------------------------------------------------------
Type = 31 (0x1f): c360 - Custom property

如果我搜索"c360-自定义属性"这个特定术语,我的项目将显示在结果列表中.到目前为止一切顺利.

If I search for this specific term 'c360 - Custom property' my items are shown in the list of results. So far so good.

现在,我想在自定义查询中检索该属性的值.这是我写的:

Now, I would like to retrieve the value of that property in my custom query. This is what I write:

" SET PROPERTYNAME'4A7594E4-FE14-4F6B-88C8-494EA4B001E9'PROPID 0x01 AS c360.CustomProperty;从SystemIndex选择SELECT c360.CustomProperty,System.ItemUrl"

"SET PROPERTYNAME '4A7594E4-FE14-4F6B-88C8-494EA4B001E9' PROPID 0x01 AS c360.CustomProperty; SELECT c360.CustomProperty, System.ItemUrl FROM SystemIndex"

第一列(c360.CustomProperty)返回为空.没有错误,但未返回值(c360-自定义属性).请注意,属性GUID和PROPID都是正确的.还要注意,我没有为SET PROPERTYNAME语句指定TYPE,因为它默认为字符串.

The first column (c360.CustomProperty) comes back empty. There is no error but the value (c360 - Custom property) is not returned. Please note that both that property GUID and the PROPID are correct. Also note that I did not specify the TYPE for SET PROPERTYNAME statement as it defaults to string.

此属性为空的原因可能是什么?我需要检查什么以确保返回值?

What could be the reason for this property being empty? What do I need to check to make sure the value comes back?

谢谢.

Sanin

推荐答案

只是偶然发现了这个线程……显然,这个答复对游戏来说已经很晚了.但是,问题可能是您使用的propID为1. 0和1被保留. SQL语法中也可能有一些错误,但是我对此不太熟悉,因此无法确定.

Just stumbled across this thread... obviously this reply is quite late to the game.  Nonetheless, the problem is likely that you used a propID of 1.  For reasons related to legacy compatilibity with the OLE Structured Storage system, propIDs must start at 2; 0 and 1 are reserved.  It's also possible that there's some error in the SQL syntax, but I'm less familiar with that so I can't say for sure.


这篇关于查询自定义属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆