Skip to content

Commit 319dad8

Browse files
committed
Update README examples to use 'sample-site' and locale
Replaces 'MySite' and 'your-site-name' with 'sample-site' in code, REST, and GraphQL examples. Adds 'localeRequest' and updates locale parameters to 'en_US' for consistency and clarity in usage instructions.
1 parent 41e12f7 commit 319dad8

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

README.adoc

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,11 @@ import { TurSNSiteSearchService } from '@openviglet/turing-js-sdk';
141141
const searchService = new TurSNSiteSearchService('http://localhost:2700');
142142
143143
// Perform search
144-
const results = await searchService.search('MySite', {
144+
const results = await searchService.search('sample-site', {
145145
q: 'machine learning',
146146
rows: 10,
147-
currentPage: 1
147+
currentPage: 1,
148+
localeRequest: 'en_US',
148149
});
149150
150151
console.log(`Found ${results.queryContext?.count} results`);
@@ -159,20 +160,9 @@ results.results?.document?.forEach(doc => {
159160
[source,bash]
160161
----
161162
# Search via REST API
162-
curl -X GET "http://localhost:2700/api/sn/MySite/search?q=artificial%20intelligence&rows=10"
163-
164-
# Index a document
165-
curl -X POST "http://localhost:2700/api/sn/MySite" \
166-
-H "Content-Type: application/json" \
167-
-d '{
168-
"documents": [{
169-
"id": "doc1",
170-
"title": "Introduction to AI",
171-
"content": "Artificial Intelligence is transforming industries...",
172-
"category": "Technology"
173-
}]
174-
}'
163+
curl -X GET "http://localhost:2700/api/sn/sample-site/search?q=artificial%20intelligence&rows=10&_setlocale=en_US"
175164
----
165+
176166
=== GraphQL API Example
177167

178168
=== API Endpoints
@@ -186,14 +176,14 @@ curl -X POST "http://localhost:2700/api/sn/MySite" \
186176
----
187177
query {
188178
siteSearch(
189-
siteName: "your-site-name"
179+
siteName: "sample-site"
190180
searchParams: {
191181
q: "technology"
192182
rows: 10
193183
p: 1
194184
sort: "relevance"
195185
}
196-
locale: "en"
186+
locale: "en_US"
197187
) {
198188
queryContext {
199189
count

0 commit comments

Comments
 (0)