Skip to content

Commit 40ef7c6

Browse files
fix: update query description in search APIs (#56)
1 parent d92a614 commit 40ef7c6

File tree

2 files changed

+56
-3
lines changed

2 files changed

+56
-3
lines changed

src/codeocean/capsule.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,38 @@ class CapsuleSearchParams:
140140
query: Optional[str] = dataclass_field(
141141
default=None,
142142
metadata={
143-
"description": "Search query in free text or structured format (name:... tag:...)"
143+
"description": """Search expression supporting free text and field:value filters.
144+
Valid fields:
145+
- id
146+
- name
147+
- doi
148+
- tag
149+
- field
150+
- affiliation
151+
- journal
152+
- article
153+
- author
154+
155+
Free text:
156+
- Matches across weighted fields (name, tags, description, authors, etc.)
157+
158+
Syntax rules:
159+
- Same field repeated = OR
160+
- Different fields = AND
161+
- Quotes = exact phrase
162+
- No explicit OR operator
163+
- No wildcards (*)
164+
- Not case sensitive
165+
166+
Notes:
167+
- "description" is not directly searchable; it is covered by free-text matching.
168+
169+
Examples:
170+
- name:RNA-seq tag:genomics
171+
- name:"single cell analysis"
172+
- Synergy
173+
- name:Synergy
174+
"""
144175
},
145176
)
146177
next_token: Optional[str] = dataclass_field(

src/codeocean/data_asset.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,30 @@ class DataAssetSearchParams:
538538
query: Optional[str] = field(
539539
default=None,
540540
metadata={
541-
"description": "Search query in free text or structured format "
542-
"(name:... tag:... run_script:... commit_id:...)",
541+
"description": """Search expression supporting free text and field:value filters.
542+
Valid fields:
543+
- name
544+
- tag
545+
- run_script
546+
- commit_id
547+
- contained_data_id
548+
549+
Free text:
550+
- Matches across weighted fields (name, tags, description, custom metadata)
551+
552+
Syntax rules:
553+
- Same field repeated = OR
554+
- Different fields = AND
555+
- Quotes = exact phrase
556+
- No explicit OR operator
557+
- No wildcards (*)
558+
- Not case sensitive
559+
560+
Examples:
561+
- name:RNA-seq tag:genomics
562+
- name:"analysis pipeline"
563+
- name:Synergy
564+
"""
543565
},
544566
)
545567
next_token: Optional[str] = field(

0 commit comments

Comments
 (0)