Comments (8)
Interesting. I don't like the idea of blacklisting export
as something special which cannot be allowed as a valid document ID.
Can we define the export end-point as /collections/{collectionName}/export.jsonl
? It indicates that you are exporting the contents of the collection as jsonl
.
from typesense.
Can we define the export end-point as /collections/{collectionName}/export.jsonl? It indicates that you are exporting the contents of the collection as jsonl
Yeah that works.
On 2nd thought, this could also mean that you're exporting the collection, meaning the schema that you posted, in addition to the documents. So it is a little confusing. Let me think about alternatives.
Although, I think we should probably use the Content-Type header to indicate the format instead of putting it in the URL. May be application/jsonl
?
from typesense.
Btw, we have the same conceptual problem with the search endpoint, but the server already handles this case fine:
/collections/{collectionName}/documents/search
collides with /collections/{collectionName}/documents/{id}
So we've actually already blacklisted search
from being a valid document ID
from typesense.
Here's an idea to solve both the export and search endpoints:
GET /collections/{collectionName}/documents?q=Stark&filter_by=...
for the search endpoint - you're essentially GETing documents and filtering when you do a search. We'll have to change the format of the returned results though in this case.
GET /collections/{collectionName}/documents
with a Content-Type of application/jsonl will export all documents in JSONL format.
The nice thing about this is that you could also export the results of a search in JSONL format. So it's the same endpoint serving both purposes.
Let me know if this works and I can massage the Response data model appropriately in the spec.
from typesense.
Btw, we have the same conceptual problem with the search endpoint, but the server already handles this case
I just realized that we can handle this easily if we place the /documents/:id
routes right at the bottom after /documents/search
and /documents/export
. That's why it worked for the search end-point. This is an easy change, so I recommend that we do that. We don't expect to have too many /documents/X
endpoints so it should be fine. Even Twitter and Github have the same problem (with the username in the URL) and they are fine :)
If this is fine, I will go ahead and re-order the routes.
from typesense.
Yup, that works!
from typesense.
Fixed - you can pull the docker image again and test.
from typesense.
Yup, works 👍
I've updated the API spec in typesense/typesense-api-spec#3
from typesense.
Related Issues (20)
- Optimizing Query Suggestions HOT 1
- [Silly question] How does search speed scale with CPUs for a single query HOT 1
- Index problems with a special Icelandic character HOT 4
- Synonyms like k8s <-> kubernetes aren't working with enabled stemming HOT 3
- Typesense on start rejects override rule with empty query HOT 1
- Modify attribute like enabled_nested_fields on existing collection HOT 1
- Support package signing for DEB/RPM package
- [Joins] join with no filter results in the error "Filter value cannot be empty". HOT 1
- [Feature Request] Tracking popular filters and sorts HOT 1
- Adding support to load a conversation from an external system (beyond the TTL) for RAG
- Using ticks (`) prevents prefix matching from working
- Using 'sort' in the field name interferes with the TS parser
- RAM spike when selecting final page HOT 1
- Allow special characters for the facet range labels
- Question around `vector_query` param HOT 1
- [Joins] Support for sorting and limiting the number of items in a joined collection. HOT 2
- Range facet values not returned when filtering
- bazel build failure HOT 2
- Not able to add data into a nested indexed field when optional flag is false in the schema HOT 2
- [Feature Request] Support querying joined fields HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typesense.