Coder Social home page Coder Social logo

Comments (11)

eklem avatar eklem commented on June 14, 2024
*abvacidaromabitternesscodecolorcontainerSizecontainerTypecorkdescriptiondistrictfreshnessfullnessidimagemainCountrynamepricepricePerLiterproductSelectionproductTyperawMaterialstorablesugarsummarysweetnesstanninstastevintage

from norch.

fergiemcdowall avatar fergiemcdowall commented on June 14, 2024

Yes, it would probably be better if you could ask for an array. I'll look into it...

from norch.

eklem avatar eklem commented on June 14, 2024

Doesn't need to be an array, but now it's just one long string without anything to split up on =)

from norch.

fergiemcdowall avatar fergiemcdowall commented on June 14, 2024

Have you tried doing it like this? https://github.com/fergiemcdowall/norch/blob/master/test/test.js#L72-L85

Either way- I think an array is a bit more accessible to people

from norch.

eklem avatar eklem commented on June 14, 2024

Strange, this is the response I get from norch:
screen shot 2017-03-03 at 12 55 59

from norch.

eklem avatar eklem commented on June 14, 2024

Anyway =)

from norch.

fergiemcdowall avatar fergiemcdowall commented on June 14, 2024

Yes- this is a bit tricky because responses are streams. (I think) it is streaming the fieldnames and showing you the end result. An array would be easier

from norch.

eklem avatar eklem commented on June 14, 2024

But, when thinking about it, I think you should keep it as a streaming interface but just wrap it as objects where the value is the string/field-name. One reason is that I now have two response processors. One for stream of objects and one for objects. Keeping it like that makes it clean.

Something like:

{"fieldname":"*"}
{"fieldname":"abv"}
{"fieldname":"acid"}
{"fieldname":"aroma"}
{"fieldname":"bitterness"}
{"fieldname":"code"}
{"fieldname":"color"}
{"fieldname":"containerSize"}
{"fieldname":"containerType"}
{"fieldname":"cork"}
{"fieldname":"description"}
{"fieldname":"district"}
{"fieldname":"freshness"}
{"fieldname":"fullness"}
{"fieldname":"id"}
{"fieldname":"image"}
{"fieldname":"mainCountry"}
...

from norch.

fergiemcdowall avatar fergiemcdowall commented on June 14, 2024

Yes- that makes sense

from norch.

eklem avatar eklem commented on June 14, 2024

I'll look into fixing this in search-index-searcher

from norch.

eklem avatar eklem commented on June 14, 2024

@fergiemcdowall I manage to re-write the output to be key/value as suggested above, but how do I get to define Content-Type = application/JSON?

To ask in a different way. How do you get the other endpoints like /search i.e. to return Content-Type = application/JSON?

from norch.

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.