Sha256: 2e4c57474e951984f917e391eb8d4cae4a386c322afd02c0e84a7700d37fe428

Contents?: true

Size: 815 Bytes

Versions: 20

Compression:

Stored size: 815 Bytes

Contents

---
title: Searchers
weight: 5
layout: guides
---

Searchers are used to lookup and scan objects in the ledger.  A searcher takes a `client`, `query` string and optional `pagination` hash.  For example, to search customer's by name:

```ruby
searcher = LedgerSync::Ledgers::QuickBooksOnline::Customer::Searcher.new(
  client: client # assuming this is defined,
  query: 'test'
)

result = searcher.search # returns a LedgerSync::SearchResult

if result.success?
  resources = result.resources
  # Do something with found resources
else # result.failure?
  raise result.error
end

# Different ledgers may use different pagination strategies.  In order
# to get the next and previous set of results, you can use the following:
next_searcher = searcher.next_searcher
previous_searcher = searcher.previous_searcher
```

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ledger_sync-3.0.0 documentation/site/guides/architecture/searchers.md
ledger_sync-2.6.0 documentation/site/guides/architecture/searchers.md
ledger_sync-2.5.0 documentation/site/guides/architecture/searchers.md
ledger_sync-2.4.4 documentation/site/guides/architecture/searchers.md
ledger_sync-2.3.1 documentation/site/guides/architecture/searchers.md
ledger_sync-2.2.3 documentation/site/guides/architecture/searchers.md
ledger_sync-2.2.1 documentation/site/guides/architecture/searchers.md
ledger_sync-2.2.0 documentation/site/guides/architecture/searchers.md
ledger_sync-2.0.2 documentation/site/guides/architecture/searchers.md
ledger_sync-2.0.1 documentation/site/guides/architecture/searchers.md
ledger_sync-2.0.0 documentation/site/guides/architecture/searchers.md
ledger_sync-2.0.0.pre.1 documentation/site/guides/architecture/searchers.md
ledger_sync-1.8.1 documentation/site/guides/architecture/searchers.md
ledger_sync-1.8.0 documentation/site/guides/architecture/searchers.md
ledger_sync-1.7.0 documentation/site/guides/architecture/searchers.md
ledger_sync-1.6.0 documentation/site/guides/architecture/searchers.md
ledger_sync-1.5.2 documentation/site/guides/architecture/searchers.md
ledger_sync-1.5.1 documentation/site/guides/architecture/searchers.md
ledger_sync-1.5.0 documentation/site/guides/architecture/searchers.md
ledger_sync-1.4.4 documentation/site/guides/architecture/searchers.md