mwmitchell / flux Goto Github PK
View Code? Open in Web Editor NEWa clojure client for solr
a clojure client for solr
In order to make Flux simpler to get started with, it would be useful to have examples that show how to query Solr using Flux. Some of the Solr components that would be nice to see could be some of these:
These examples could be inlined with the main README file or as a separate document.
Hi,
I've written a lot of integration tests for flux, as well as some comments on what people should expect when querying. What's the contribution procedure? I normally use git-flow, so I'm building them on a development
branch on my fork, but flux seems to keep only master (and dev is out of date).
It took a little while for me to realise that the flux.cloud
namespace was added after the current release. Is there any chance of that release being made? I'm keen to use Flux to connect to a SolrCloud cluster!
Currently, Flux lacks documentation on its code/functions. Because of this, there's no way to build docs dynamically. Any public function/namespace within Flux should be documented with a doc string. Something like marginalia
[1] could then be used for publishing docs.
Just got to the part I try to connect to a real solr and it seems there are few problems the midje test not digged into. I'm on it and will let you know when everything is fixed and tested against solr.
ToDo:
I'm currently not sure if the embedded version is of use? https://cwiki.apache.org/confluence/display/solr/EmbeddedSolr state:
The concept of "Embedded Solr" came about in 2007 when some Java developers wanted to get the goodies Solr added on top of the Lucene Java API, but without running a separate Java process.
This wiki page originally served as an example of how, by directly compiling against the classes provided in the Solr WAR, you could add code directly to an existing Java application to do the necessary setup to initialize a SolrCore, add documents to the index, and execute queries.
Those examples are still available in the historic versions of this page, but they are no longer recommended (not that they ever really were).
The simplest, safest, way to use Solr is via Solr's standard HTTP interfaces. Embedding Solr is less flexible, harder to support, not as well tested, and should be reserved for special circumstances.
SolrJ offers more - leverage more of the methods available - https://cwiki.apache.org/confluence/display/solr/Using+SolrJ
As you know I am playing with flux currently without much knowledge of solr. Inspired by some sql libraries what do you think about a more clojure way building queries?
What I've done so far:
(q (or {:en 1}
(and {"de" 2}
(+ :foo)
(- "test"))
{:fr (not 4 "bar")}))
;; => "q=(en:1 || (de:2 && +foo && -test) || fr ! 4 && fr ! bar)"
;; Do you prefer (implemented both, nothing more to decide here)
(q {"foo" [:* 4]})
;; or
(q {"foo" (range :* 4)})
;; => "q=foo:[* TO 4]"
I'm not sure if those prohibits and requires are correct this way.
As said I start using solr now and not build many queries before. It would help me to add cases to this query builder when you show me some sample query strings.
Not sure if it's all if I go through examples of solr as alternative
It would be great to see a SolrServer type hint on this call to .query. Profiling shows that a significant amount of CPU is being spent on reflection against the solr-server object. Obviously, type hints against other method calls would also be of benefit, but that's the big one we're seeing.
Would a pull request be helpful?
Commit 62ae93e introduced a regression when converting NamedList objects. In previous version, covert-named-list returned a map with string keys converted to keywords. The new ->clojure multi method will return a vector of 2-element vectors when called on a NamedList (string keys not converted). Fix available in pull request [#4].
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.