Coder Social home page Coder Social logo

Comments (11)

iross avatar iross commented on August 20, 2024

https://github.com/UW-COSMOS/Cosmos/blob/master/cosmos/birdnest_backend/birdnest_backend/app.py#L268

Looks like it does a "match" as opposed to a "match phrase" (which is what we use in the xDD API). So multiple words are treated as an OR.

from cosmos.

cambro avatar cambro commented on August 20, 2024

That's what I thought. We should probably try to incorporate a switch for how multiple terms are handled in ES, which requires both front end and back end work. The first step is to distinguish multiple terms from a search phrase. Comma-separation would probably be best. Want to coordinate with @davenquinn about this @iross?

from cosmos.

davenquinn avatar davenquinn commented on August 20, 2024

If we default to "and" (match phrase I guess) and split the search string on commas to generate "or" relationships, could this be done without involving the frontend?

from cosmos.

iross avatar iross commented on August 20, 2024

from cosmos.

cambro avatar cambro commented on August 20, 2024

Exactly as stated.

  1. multiple terms no commas is a phrase
  2. multiple terms, comma separated: default to inclusive "and", optional "or" would be good

Edit: @iross this search is not over the document, it is over individual cosmos table, figure, equation elements.

from cosmos.

davenquinn avatar davenquinn commented on August 20, 2024

OK, so we would need an and/or switch in the API and frontend.

from cosmos.

iross avatar iross commented on August 20, 2024

Logic has been updated in the live instance. on the search_es_objects endpoint:

  • Search now uses match_phrase by default, so multiple terms with no commas is searched as a full phrase
  • Comma-separated lists are treated as separate terms, defaulting to and
  • &search_logic=any will switch comma-separated term lists to use OR logic.

Keeping this open until I propagate the changes back into master.

from cosmos.

cambro avatar cambro commented on August 20, 2024

See this issue for possible lingering problem:
UW-COSMOS/cosmos-visualizer#48

from cosmos.

davenquinn avatar davenquinn commented on August 20, 2024

Added search_logic to frontend in COSMOS/cosmos-visualizer#4e81d1d.

from cosmos.

ankur-gos avatar ankur-gos commented on August 20, 2024

@iross are the changes in master for AND/OR logic?

from cosmos.

iross avatar iross commented on August 20, 2024

Merged in ages ago. Closing.

from cosmos.

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.