Giter VIP home page Giter VIP logo

Comments (4)

19h avatar 19h commented on August 15, 2024 2

We're not using MongoDB.

That said, it appears as though we could be using a PrefixSearch: https://psychonautwiki.org/w/api.php?action=query&list=prefixsearch&pssearch=LS&format=json. The only issue is that we're not working with a generic search endpoint but with a semantic search (based on meta data inside articles). I'll look into this.

from bifrost.

19h avatar 19h commented on August 15, 2024 1

There's no such concept in MediaWiki and no resource shall be considered static. That said, substance names are sufficiently stable for them to be considered IDs. We always create redirects if a substance article is moved, and the API respects redirects.

Example: https://api.psychonautwiki.org/?query=query%7Bsubstances(query:%221plsd%22)%7Bname%7D%7D. The 1plsd query implicitly aliases to 1P-LSD.

from bifrost.

dlbnco avatar dlbnco commented on August 15, 2024

That said, substance names are sufficiently stable for them to be considered IDs.

Cool!

Still, IMO we should also have some method of querying that gives results that partially matches the query (similar behavior to the wiki's search bar).

For example, if I search for "MD" (https://api.psychonautwiki.org/?query=query%7Bsubstances(query:%22MD%22)%7Bname%7D%7D), I should receive all of the following as results:

  • MDMA
  • MDA
  • MDPV
  • MDEA
  • MDAI

Maybe use the $regex selector? https://docs.mongodb.com/manual/reference/operator/query/#query-selectors

from bifrost.

aLoneWitness avatar aLoneWitness commented on August 15, 2024

Hello, any update on this? Im trying to use the Apollo/GraphQL endpoint for a project and would really like prefix/post search capability <3

from bifrost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.