Mengubah pengaturan untuk Komponen Web Hasil Pencarian
Applies To
SharePoint dalam Microsoft 365The Search Results Web Part shows the search results of a query that was entered in a Search Box Web Part.
Secara default, Komponen Web Hasil Pencarian klasik digunakan di semua halaman vertikal pencarian default di Pusat Pencarian klasik. Pelajari tentang pengalaman pencarian klasik dan modern. Vertikal pencarian dikustomisasi untuk mencari konten tertentu, seperti (Semuanya, Orang, Percakapan, dan Video), dan menampilkan hasil pencarian yang difilter dan diformat untuk tipe konten atau kelas tertentu. The Search Results Web Part shows search results, and it also sends the search results to the Refinement Web Part and to the Search Navigation Web Part.
Catatan:Â Lihat Mengonfigurasi Komponen Web Pencarian Konten di SharePoint untuk menambahkan Komponen Web Pencarian Konten (CSWP) ke halaman Anda dan mengonfigurasinya untuk hasil yang sederhana dan tingkat lanjut.
The Search Results Web Part uses a query that's specified in the Web Part to show search results. As a SharePoint Online administrator, you can change the query or other settings for displaying search results.
Untuk menambahkan dan mengonfigurasi Komponen Web Hasil Pencarian di halaman, lihat Tentang mengonfigurasi Komponen Web Hasil Pencarian. Anda juga bisa menemukan informasi tambahan lihat Mengonfigurasi properti Komponen Web Hasil Pencarian di SharePoint Server.
Apa yang ingin Anda lakukan?
-
Mengubah konten OneDrive mana yang akan menampilkan hasil
Change the query in the Search Results Web Part
The Search Results Web Part uses a query that is specified in the Web Part to show search results. By default, this query uses the query variable {searchboxquery}. The query variable is a placeholder for a value, which means that when you run the query, a value replaces the placeholder. For example, when a user types the search term yellow in the Search Box, the {searchboxquery} variable in the Search Results Web Part searches for all items that contain the phrase yellow.
By changing the query in the Search Results Web Part, you can:
-
Change the result source to specify which content should be searched.Â
-
Add query variables or property filters to customize search results for different users or user groups.
-
Promote or demote items or pages within the search results.
-
Change the sorting of search results.
There are two main ways of changing the query:
Define the query by using Keyword Query Language (KQL) in Advanced Mode
-
Pada halaman hasil pencarian, klik Pengaturan, lalu klik Edit Halaman. Halaman hasil pencarian terbuka dalam mode Edit.
-
In the Search Results Web Part, move the pointer to the right of the Web Part title, click the arrow, and then click Edit Web Part on the menu. The Search Results Web Part tool pane opens under the ribbon in the top right of the page.
-
In the Web Part tool pane, in the Search Criteria section, click Change query. The Build Your Query dialog box opens in Advanced Mode.
-
On the BASICS tab, in the Select a query section, select a result source to specify which content should be searched.
-
You can now change the Query text. By default, the query variable {searchboxquery} is defined. Change the query text by using Keyword Query Language (KQL), or use the Keyword filter and Property filter lists to build the query:
-
The keyword query can consist of free-text keywords, property filters, or operators. Use braces to enclose query variables. The query variables will be replaced with a value when the query is run. Keyword queries have a maximum length of 2,048 characters. Untuk informasi selengkapnya tentang KQL, lihat Referensi sintaks Keyword Query Language (KQL).
-
Use keyword filters to add query variables to your query. Select predefined query variables from the list, and then add them to the query by clicking Add keyword filter. Untuk daftar variabel kueri yang tersedia, lihat Variabel kueri di SharePoint Server 2013.
-
Use property filters to query the content of managed properties that are set to queryable in the search schema. Select managed properties from the Property filter lists. Klik Tambahkan filter properti untuk menambahkan filter ke kueri.
Catatan:Â Properti terkelola kustom tidak diperlihatkan dalam daftar Filter properti . Untuk menambahkan properti terkelola kustom ke kueri Anda, dalam kotak teks Kueri , masukkan nama properti kustom yang dikelola diikuti dengan kondisi kueri, misalnya MyCustomColorProperty:Green
-
-
Click Test query to see a preview of the search results.
-
You can also add more details to your query:
-
Click OK to save the query and return to the Web Part tool pane.
Add refiners
On the REFINERS tab, you can choose to limit returned results by adding preselected refiners to your query.
You can specify that the search results that are returned in the Search Results Web Part should be limited to one or more values from the refiners. The list shows all managed properties that are enabled as refiners in the search schema.
-
To add a refiner to the query, choose a refiner from the list, and then click Add.
You can specify that the search results should be grouped based on one or more managed properties. This is useful when there are several variants for a given item, and you want to group them under a single result.
-
To define grouping of results, click Show more to show the Group results section.
Menetapkan pengurutan
Use the SORTING tab to specify how to sort search results. Anda bisa menentukan beberapa tingkat pengurutan dan menambahkan aturan untuk pengurutan dinamis.
The Sort by list shows all managed properties that are set as sortable in the search schema.
-
To sort results based on managed properties:
-
In the Sort by list, select a managed property, and then select Descending or Ascending.
-
To add more sorting levels, click Add sort level.
-
-
To sort results by relevance rank:
-
In the Sort by list, select Rank.
-
(Optional) Under Dynamic ordering, you can specify additional ranking by adding rules that will change the order of results when certain conditions apply. Click Add dynamic ordering rule, and then specify conditional rules.
-
Menambahkan pengaturan lainnya
Use the Settings tab to select more settings for your query. Anda bisa memilih untuk menggunakan aturan kueri, menggunakan penulisan ulang URL, dan menentukan apakah akan menghapus hasil duplikat atau tidak.
Menguji kueri Anda
Tab Uji memperlihatkan teks kueri akhir berdasarkan apa yang Anda pilih di tab lainnya. Anda bisa menguji kueri alternatif dengan mengedit langsung teks kueri. Anda juga bisa menguji opsi kueri berbeda dengan mengklik Perlihatkan selengkapnya.
Catatan:Â Perubahan apa pun yang Anda buat ke kueri di tab Uji tidak disimpan.
Bagian |
Deskripsi |
---|---|
Teks kueri: |
Shows the final query that will be run by the Search Results Web Part. The final query text is based on the original query template where dynamic variables are replaced with current values. Other changes to the query may be made as part of a query rule. |
Click Show more to display more information. |
|
Templat kueri |
The content of the query template that is applied to the query. |
Disempurnakan menurut |
The refiners that are applied to the query, as defined on the REFINERS tab. |
Dikelompokkan menurut |
The managed property on which search results should be grouped, as defined in the REFINERS tab. |
Aturan kueri yang diterapkan |
Memperlihatkan aturan kueri mana yang diterapkan ke kueri. |
Variabel templat kueri |
The query variables that will be applied to the query and the values of the variables that apply to the current page. Type other values to test the effect they will have on the query. |
User segment terms |
Test how the query works for different user segment terms. Click Add user segment term to add terms to the query. |
Test query |
Click the Test Query button to preview the search results. |
Define the query by using predefined values in Quick Mode
-
On the BASICS tab, make sure that you are in Advanced Mode. Click Switch to Quick Mode in the top right corner if you are in Advanced Mode.
-
In the Select a query section, select a result source to specify which content should be searched.
-
In the Restrict by app section, select an option from the list to restrict results to a specific site, library, list, or URL.
-
Choose options in the Restrict by tag section to limit results to content that's tagged with a term from a term set:
-
Don’t restrict by any tag: Search results will not be limited based on tags (default).
-
Restrict by navigation term of current page: Search results will be limited to content that's tagged with the term of the current page. The current tag is shown as the last part of the friendly URL. This choice only makes sense if your site uses managed navigation.
-
Restrict by current and child navigation: Search results will be limited to content that's tagged with the term of the current page (shown as the last part of the friendly URL), and content that's tagged with subterms of the current page. Only relevant if your site uses managed navigation.
-
Restrict on this tag: Search results will be limited to content that's tagged with the tag that you type in the box.
-
You can also add more details to your query:
-
Click OK to save the query and return to the Web Part tool pane.
Change display template settings
-
Pada halaman hasil pencarian, klik Pengaturan, lalu klik Edit Halaman. Halaman hasil pencarian terbuka dalam mode Edit.
-
In the Search Results Web Part, move your pointer to the right of the Web Part title, click the arrow, and then click Edit Web Part on the menu. The Search Results Web Part tool pane opens under the ribbon in the top right of the page.
-
In the Web Part tool pane, in the Display Templates section, in the Results Control Display Template list, you can choose a display template to control the overall look of the Web Part.
-
In the other lists in this section, you choose a display template for individual results:
-
The default selection is Use result types to display items. This selection will apply different display templates according to the result type of the search result. For example, if the result type of a search result is a PDF file, the display template PDF Item is applied. If the result type of a search result is an image, the Picture Item display template is applied.
-
To apply one display template to all result types of the search results, select Use a single template to display items, and then select the display template that you want to apply.
-
Lihat Mengubah tampilan hasil pencarian menggunakan tipe hasil dan menampilkan templat untuk informasi selengkapnya.
Change Results settings and Results control settings
-
Pada halaman hasil pencarian, klik Pengaturan, lalu klik Edit Halaman. Halaman hasil pencarian terbuka dalam mode Edit.
-
In the Search Results Web Part, move your pointer to the right of the Web Part title, click the arrow, and then click Edit Web Part on the menu. The Search Results Web Part tool pane opens under the ribbon in the top right of the page.
-
In the Web Part tool pane, in the Settings section, change Results Settings to specify how results are shown:
If you select |
Then the Web Part displays |
Selected by default |
---|---|---|
Number of results per page |
The maximum number of search results displayed per page. |
|
Show ranked results |
Ranked results. Hapus untuk memperlihatkan blok yang dipromosikan saja (seperti hasil yang dipromosikan) atau kontrol hasil (seperti hitungan hasil). |
Ya |
Show promoted results |
Search results that are promoted by using query rules. |
Ya |
Show "Did you mean?" |
Query spelling corrections as Did you mean suggestions. |
Ya |
Show View Duplicates link |
A View Duplicates link that users can click to view results that were classified as duplicates. |
Tidak |
Show link to search center |
Link to the Search Center. |
Tidak |
4. Di panel alat Komponen Web, di bagian Pengaturan , ubah pengaturan kontrol Hasil untuk menentukan opsi lainnya untuk apa yang diperlihatkan dalam Komponen Web Hasil Pencarian:
If you select |
Then the Web Part displays |
Selected by default: |
---|---|---|
Show advanced link |
A link to the Advanced Search page. |
Ya |
Show result count |
The number of results found. |
Ya |
Show language dropdown |
A language drop-down list. Gives users a way to switch the language of their query. The drop-down list will only appear if the user's selected two or more languages from the search user preferences page |
Ya |
Show sort dropdown |
A sort drop-down list. Gives users a way to change the sort order of results. |
Tidak |
Show paging |
A paging control below the search results. |
Ya |
Show preferences link |
A link to the search user preferences page. |
Ya |
Show AlertMe link |
A link to the Alert Me page. |
Ya |
Mengubah cara memperlihatkan hasil dari konten OneDrive pengguna sendiri
Secara default, pengguna melihat hasil dari konten OneDrive dan SharePoint bersama, bukan dari konten pribadi mereka. Konten OneDrive privat adalah konten mereka sendiri yang hanya dapat mereka akses.
Anda dapat menyiapkan hasil pencarian untuk memperlihatkan blok terpisah yang berisi hasil dari konten OneDrive pribadi pengguna.
-
Pada halaman hasil pencarian, klik Pengaturan, lalu klik Edit Halaman. Halaman hasil pencarian terbuka dalam mode Edit.
-
In the Search Results Web Part, move your pointer to the right of the Web Part title, click the arrow, and then click Edit Web Part on the menu. The Search Results Web Part tool pane opens under the ribbon in the top right of the page.
-
Di panel alat Komponen Web, di bagian Pengaturan , buka Juga perlihatkan hasil dari dan pilih "OneDrive mereka sendiri".
If you select |
Then the Web Part displays |
Selected by default |
---|---|---|
OneDrive mereka sendiri |
Blok terpisah dengan hasil dari OneDrive pengguna sendiri, termasuk konten yang hanya dapat diakses oleh pemilik. |
Tidak |
Lihat juga: