سؤال

نحن نبني موقع ويب على SharePoint 2013 باستخدام نشر موقع متقاطع جديد وميزات البحث. نريد تنفيذ ميزة "العناصر ذات الصلة" باستخدام جزء ويب بحث المحتوى جنبا إلى جنب مع حقول البيانات الوصفية المدارة الموجودة عبر جميع أنواع محتوى الصفحة. وبالتالي، يمكن تمييز المحتوى (عناصر الكتالوج) بحقل "مواقع" لوصف أهميتها الجغرافية عنصر المحتوى.

إذا كان لدينا صفحة عنصر كتالوج تستخدم جزء ويب بحث المحتوى (ومحتوى إعادة استخدام أجزاء الويب) لعرض معلومات الصفحات الرئيسية، فمن الممكن إذن إضافة جزء ويب آخر على الويب إلى الصفحة التي تستخدم البيانات من الاستعلام الرئيسي (أي محتويات حقل الموقع) لتشغيل بحث آخر لاستعادة جميع المحتويات الأخرى المطابقة لنفس الموقع. في سياقنا، يسمح حقل الموقع بقيم متعددة من الناحية المثالية، سيكون قادرا على المطابقة على عناصر متعددة أيضا.

أعرف أن هذا ممكن مع حقول بيانات التعريف ذات القيمة الفردية في عام 2010 باستخدام جزء ويب لاستعلام المحتوى ولكن هذه الوظيفة تكرارها في جزء ويب بحث المحتوى؟

أستطيع أن أرى أنه يمكنك مطابقتك على علامة، ولكن هذا يعتمد عليك ترميزا بجد قيمة في جزء ويب، نريد أن تكون ديناميكية بناء على القيم الأخرى على الصفحة. يمكنني أيضا أن أرى أنه يمكنك استخدام قيمة "الحقل" من "الصفحة الحالية" كمرشح خاصية في جزء ويب بحث المحتوى. فهمي على الرغم من أن العناصر التي تم سحبها من البحث ليست "حقول في الصفحة".

هل يعرف أحد كيفية تنفيذ هذه الميزة باستخدام ميزات البحث SharePoint 2013؟ أو تقديم أي روابط إلى توثيق هذه العملية؟

شكرا.

هل كانت مفيدة؟

المحلول

I've found a way to accomplish this given a situation where the managed property value I need to make the secondary/related CSWP lookup happens to be exposed in the URL of the primary catalog item.

I.e., a People Catalog with a catalog item URL of (/directory/Last, First) --- I want to show activities related to that person (from an Activities Catalog at /activities/Activity Title) on the person's catalog item page.

So in the Activities Catalog I created a site column 'Credit' and populated it with values of 'Last, First' - then on the People Catalog individual item page I went into edit mode, added a CSWP, and leveraged the "value of a token from URL" advanced query parameter to search the Activities list:

(contentclass:sts_listitem OR IsDocument:True) SPSiteUrl:http://authsite.organization.com ListId:6b291282-99e7-4d97-a5ff-activitieslistGUID CreditOWSTEXT:{URLToken.1}

I have not yet found a way to directly pass a value retrieved from one CSWP to another CSWP as a query filter parameter, though my brain sort of expects that capability to be there somewhere, and it might just be a case of my overlooking something obvious or under-documented (or maybe just my glazing over while reading documentation.)

I also have not yet found a good way to work this relationship in reverse. In other words, the Activities Catalog item URLs look like /activities/ActivityTitle so I'm not able to add a second CSWP on an individual activity page and have it query the person, since their name isn't exposed in the URL, and I don't want to add a column to a person which contains the titles of all activities related to them (though I suppose that could work.)

Though the Credit column I created above is a Single Line of Text field, it is populated on the authoring site through an on-modify workflow that copies the value from a lookup field. (In other words, the content manager on the authoring site selects the value from a Lookup field, and a workflow populates the text field with the lookup value.) I did this since it's so much easier to work with text fields in CSWP than lookup fields, though I expect that as I become more capable this might not prove necessary.

If you want to know more about the solution described above, just let me know... happy to discuss. Relating information between lists continues to feel more an art than a science, especially on opposite sides of the search service, and I continue to learn better techniques everyday!

PS - I haven't played much with web API services, but rather than nesting a CSWP in the individual catalog item page, I'd assume if the DOM output produced is solid, you could use client-side JavaScript to read a field value from the rendered CSWP page (based on ID or name or something) and run a subsequent AJAX query against another list to retrieve related values.

Peace and Joy!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top