- Querying and search
Premium search
Premium search represents OrderCloud's next evolution in search technology, powered by Elasticsearch. This enhancement delivers significant improvements in search capabilities, performance, and user experience.
Key benefits
1. Performance optimization
- Significantly improved response times
- Enhanced large dataset handling
- Optimized query processing
- Improved system responsiveness
2. Enhanced search capabilities
Natural language processing:
- Word stemming for plural inference
- Comprehensive synonym matching
- Intelligent result ranking
- Google-like search experience
Search flexibility:
- Multiple search patterns
- Context-aware matching
- Relevance-based results
- Intuitive user experience
3. Advanced features
Metadata and navigation
- Rich faceted navigation support
- Dynamic metadata generation
- Flexible categorization
- Enhanced filtering options
Extended property handling
-
Full xp field searchability
-
Wildcard pattern support:
-
Automatic field indexing
-
No manual index creation
Search operations
-
Universal field sorting
-
Multi-field OR filters:
-
Complex query support
-
Flexible search patterns
API coverage
Available endpoints
-
Buyer product lists:
-
Seller product management:
-
Order operations:
Integration points
- Product catalog searches
- Order management queries
- Custom implementations
- API integrations
Implementation details
Cost structure
- Included in core platform
- No additional charges
- Standard feature access
- Gradual rollout process
Compatibility considerations
Endpoint compatibility
- Maintains existing endpoints
- Preserves parameter functionality
- Supports current integrations
- Ensures API consistency
Search behavior changes
Natural language focus:
- Semantic matching priority
- Context-aware results
- Example changes:
- "eats" matches "eat" (word stem)
- "eats" doesn't match "beats" (unrelated)
- Previous behavior was opposite
Exact matching options:
-
Use wildcard filters
-
Consider performance impacts
-
Example pattern:
-
Leading wildcard considerations
Performance considerations
-
Query optimization:
- Prefer targeted searches
- Avoid leading wildcards
- Use specific filters
- Implement pagination
-
Result handling:
- Process manageable sets
- Implement caching
- Handle large datasets
- Monitor performance
Production status
Current deployment
- Live since mid-2018
- Extensive production testing
- Major customer adoption
- Proven reliability
Implementation status
- Production-ready feature
- Default for new systems
- Comprehensive testing
- Continuous improvements
Rollout strategy
- Gradual client migration
- Controlled deployment
- Performance monitoring
- System optimization
Best practices
Search implementation
-
Prefer natural language:
- Use semantic searches
- Implement word stemming
- Enable synonym matching
- Support variations
-
Performance optimization:
- Avoid leading wildcards
- Use targeted searches
- Implement pagination
- Monitor response times
-
Result handling:
- Process manageable sets
- Implement caching
- Handle large datasets
- Provide feedback
Migration considerations
-
Review current searches:
- Identify exact matches
- Update search patterns
- Test modifications
- Verify results
-
Update integrations:
- Modify search calls
- Adjust result handling
- Test functionality
- Monitor performance
Support resources
Community access
Join the OrderCloud Developer Community for:
- Implementation guidance
- Best practices
- Problem solving
- Feature updates
Documentation
- Technical specifications
- Implementation guides
- API references
- Example code
New features for premium search
Since introducing Elasticsearch-powered Premium Search for products, we've made significant improvements based on implementation feedback and performance monitoring.
Premium search for admin endpoints
The Premium Search engine now powers both v1/me/products (buyer experience) and v1/products (admin experience).
Rollout schedule:
- New organizations enabled by default (since February 2020)
- Selected clients/partners transitioned individually
- Test/Dev organizations transitioned (April 3, 2020)
- All remaining organizations transitioned (April 20, 2020)
- Remove Product xp indexes and disable new index creation*
*Premium Search automatically enables searching, sorting, and filtering for all xp fields.
Important behavioral note
While API specifications remain unchanged, cached data behavior requires attention:
- Write operations (
POST/PUT/PATCH) return fresh, consistent data GEToperations may return cached data- Immediate
GETafter write may return stale data
Organizations created after February 12, 2020 already have these behaviors enabled.
New searchType parameter
To provide more control over search results, we've introduced the searchType parameter:
| Type | Description |
|---|---|
AnyTerm | Default. Any search word must appear in any searchable field |
AllTermsAnyField | All search words must appear across searchable fields |
AllTermsSameField | All search words must appear in the same searchable field |
ExactPhrase | Exact phrase match (case insensitive) in any searchable field |
ExactPhrasePrefix | Like ExactPhrase, but allows incomplete last word (ideal for type-ahead) |
The parameter is available on:
v1/productsv1/me/products
Usage recommendations
Consider these search behavior principles:
- Result ranking remains consistent across search types
- Exact phrase matches rank higher than individual terms
- More term matches rank higher than fewer
IDandNamematches rank higher thanDescription- Users rarely explore beyond first page of well-ranked results
- Overly restrictive searches may hide relevant results
Premium search for orders
The Elasticsearch-powered premium search features now extend to orders and line items, bringing advanced search capabilities previously available only for products. These enhancements apply exclusively to submitted orders (IsSubmitted=true), providing improved search performance and functionality.
Enhanced order search capabilities
The GET v1/orders/{direction} endpoint now includes powerful search features:
Natural language search
- "Fuzzy" matching on fields like
Order.Comments - Intelligent relevance-based result ranking
- Improved search accuracy and flexibility
Advanced filtering
-
Line item property filtering:
-
Nested field filtering:
-
Field-level "OR" filters:
Additional features
- Support for the searchType parameter
- Automatic xp field indexing for submitted orders
- No manual index configuration required
- All xp fields immediately searchable
- Significantly improved performance
- Faster complex queries
- Better handling of xp filters
- Optimized search operations
Cross-order line item search
The new endpoint v1/lineitems/{direction} enables comprehensive line item searching across multiple orders, addressing limitations of the single-order endpoint v1/orders/{direction}/{id}/lineitems.
Key capabilities
- Search across all orders simultaneously
- Filter by line item properties
- Filter by order-level fields using
Orderprefix - Combine multiple filter criteria
Example query:
Response details
- Includes standard
LineItemfields - Adds
OrderIDfor order reference - Supports all enhanced search features
- Enables complex data analysis
Use cases:
- Product sales analysis
- Order history investigation
- Cross-order item tracking
- Performance reporting
Important considerations
1. Submitted orders only
- Applies to orders with
IsSubmitted=true - Orders awaiting approval not considered submitted
- Cannot combine submitted and unsubmitted orders in queries
- Default behavior:
- Assumes submitted orders
- Override with:
IsSubmitted=FalseStatus=UnsubmittedStatus=AwaitingApproval
2. Natural language search implications
- Results may differ from exact matching
- Provides more intuitive search behavior
- Alternative options:
- Use wildcard filters for exact matching
- Avoid leading wildcards for performance
- Consider search term relevance
3. Search result caching
- Changes to submitted orders not immediately visible
- Update timing:
- Typical: Few seconds
- Maximum: Few minutes
- Plan for slight data latency
4. XP field management
- Adding new fields: Safe operation
- Changing data types: Exercise caution
- May affect Elasticsearch indexing
- Could reject entire order from index
- Same applies to line items
- Best practices:
- Maintain consistent schemas
- Plan field types carefully
- Document data type changes
5. Sorting requirements
Cross-order line item sorting rules:
-
Must start with order-level field
-
Valid example:
-
Invalid example:
6. Filter combinations
Restrictions on field combinations:
-
Cannot combine order and item fields in OR expressions
-
Invalid example:
Beta status notes
- Subject to potential adjustments
- Focus on performance optimization
- Possible limits on result set sizes
- Changes will be communicated in advance
NextPageKey pagination
The Meta.NextPageKey field introduces efficient pagination for line items across orders.
Implementation
-
Initial request:
-
Subsequent requests:
Best practices
-
Omit
pageandpageSizewithpageKey -
Use
Meta.NextPageKeyfrom previous response -
Implement date range filtering:
-
Break large datasets into manageable chunks
Performance considerations
- Pagination depth affects performance
- Use filters to reduce result sets
- Consider date-based filtering
- Implement reasonable page sizes
Feature availability
Non-production environments
- Enabled by default
- Available for testing
- No activation required
Production environments
- Automatic for marketplaces created after April 20, 2022
- Older marketplaces:
- Requires manual activation
- Contact OrderCloud support
- Quick enablement process
Using order search to suit your needs
Premium search for orders and line items provides enhanced search and filtering capabilities for the orders endpoint. This feature enables custom order management screens, reporting interfaces, and unique buyer order history experiences.
Line item search capabilities
Sales metrics
Get total quantity sold or gross sales by product:
Fulfillment tracking
Find unfulfilled items:
Promotion analysis
Track discounted purchases:
Track non-discounted purchases:
Time-based analysis
Get items sold in specific period:
Note: All dates use UTC format
User history
View customer purchase history:
Supplier analysis
Compare supplier performance:
Note: Requires supplier/seller user with OrderAdmin and OrderReader roles.
Order filtering
Product-based filtering
Find orders containing specific products:
Address filtering
Orders with California billing:
Multiple state filtering:
Search optimization
Search types
- Default: AnyTerm
- Expanded: Product and order data
- Configurable ranking
Example scenario
Sample product names:
- Button-up Black Shirt
- Sleeveless Black Shirt
- Cotton Blue Shirt
- High-top Black Shoes
- Canvas White Shoes
Basic search
Find orders with any shirts:
Refined search
Find orders with black shirts:
Line item retrieval
Get order line items:
Supplier/seller search
Alternative URL format:
Comment search
Fuzzy search in comments:
Implementation notes
Order submission status
- Default: Returns submitted orders
- Unsubmitted orders require explicit filter:
Extended properties
Filter by xp without indexing:
Pagination optimization
Use NextPageKey for better performance:
