Check if member is boosting server - discord

I wanted to check if a Member is boosting and how much they have boosted the server. Any way to do so? I know you have the GuildMemberUpdateBoostTimeEvent but that doesn't allow me to check how much a certain individual has boosted the server. Does anyone know?
(Only methods the GuildMemberUpdateBoostTimeEvent has are e.getNewTimeBoosted() and e.getOldTimeBoosted())

There is also Member.isBoosting().

Related

How to access a SOLR-synonym dictionary from a SOLR client?

Imagine a search engine that doesn't have the word 'Iran' in the index. If a user searches for 'Iran' we have no results. We could use SOLR's spelling correction and suggest 'iron' instead. Alternatively, we could use a synonym dictionary and replace 'Iran' by 'Persia' (assuming 'Persia' is in the index). However, we don't know what the user wants to search for. So I would like to present both words, 'Persia' and 'iron', as suggestions.
Thus my question: can I access the synonym dictionary from the SOLR-client?
I am not sure, whether this should be solved by SOLR at all. It would of course be easy to store the synonym list e.g. in a SQL-Database and get suggestions from there. On the other hand it might be good to keep the number of systems and dependencies as small as possible.
You can access synonyms file using simple GET method and then you can do the mapping.
localhost:8983/solr/#/coreName/files?file=synonyms.txt

Solr queries stored within Solr field

I have a set of keywords defined by client requirements stored in a SOLR field. I also have a never ending stream of sentences entering the system.
By using the sentence as the query against the keywords I am able to find those sentences that match the keywords. This is working well and I am pleased. What I have essentially done is reverse the way in which SOLR is normally used by storing the query in Solr and passing the text in as the query.
Now I would like to be able to extend the idea of having just a keyword in a field to having a more fully formed SOLR query in a field. Doing so would allow proximity searching etc. But, of course, this is where life becomes awkward. Placing SOLR query operators into a field will not work as they need to be escaped.
Does anyone know if it might be possible to use the SOLR "query" function or perhaps write a java class that would enable such functionality? Or is the idea blowing just a bit too much against the SOLR winds?
Thanks in advance.
ES has percolate for this - for Solr you'll usually index the document as a single document in a memory based core / index and then run the queries against that (which is what ES at least used to do internally, IIRC).
I would check out the percolate api with ElasticSearch. It would sure be easier using this api than having to write your own in Solr.

Is it possible to change document ranking in Lucene index?

What I would like to have is when a user searches for a specific term or phrase, I would like lucene to return a certain document as first result...
Knowing that my documents are rows in a SQL server database.
Thank you in advance.
If you know which document you want to show first, you dont need to bother with Lucene specifics to achieve what you want.
Simply show it first, and when you iterate your search results skip it, since you know you already displayed it.

Solr equivalent to ElasticSearch Mapping Type

ElasticSearch has Mapping Types to, according to the docs:
Mapping types are a way to divide the documents in an index into
logical groups. Think of it as tables in a database.
Is there an equivalent in Solr for this?
I have seen that some people include a new field in the documents and later on they use this new field to limit the search to a certain type of documents, but as I understand it, they have to share the schema and (I believe) ElasticSearch Mapping Type doesn't. So, is there an equivalent?
Or, maybe a better question,
If I have a multiple document types and I want to limit searches to a certain document type, which one should offer a better solution?
I hope this question has any sense since I'm new to both of them.
Thanks!
You can configure multicore solr:
http://wiki.apache.org/solr/CoreAdmin
Maybe something has changed since solr 4.0 and it's easier now, i didn't look at it since i have switched to elasticsearch. Personally i find elasticsearch indexes/types system much better than that.
In Solr 4+.
If you are planning to do faceting or any other calculations across multiple types than create a single schema with a differentiator field. Then, on your business/mapping/client layer just define only the fields you actually want to look at. Use custom search handlers with 'fl' field to only return the fields relevant to that object. Of course, that means that all those single-type-only fields cannot be compulsory.
If your document types are completely disjoint, you can create a core/collection per type, each with its own definition file. You have full separation, but still have only one Solr server to maintain.
I have seen that some people include a new field in the documents and later on they use this new field to limit the search to a certain type of documents, but as I understand it, they have to share the schema and (I believe) ElasticSearch Mapping Type doesn't.
You can exactly do this in Solr. Add a field and use it to filter.
It is correct that Mapping Types in ElasticSearch do not have to share the same schema but under the hood ElasticSearch uses only ONE schema for all Mapping Types. So technical it makes to difference. In fact the MappingType is mapped to an internal schema field.

Is there any lucene/solr spell checker which can handle space insertions/removal typos?

As far as I know almost all do spell checking based on single query term and are unable to do changes on whole input query to increase coverage in corpra. I have one in lingpipe but it is very expensive... http://alias-i.com/lingpipe/demos/tutorial/querySpellChecker/read-me.html
So my question what is the best Apache alternative to lingpipe like spell checker?
The spellcheckers in lucene treat whitespace like any other character. So in general you can feed them your query logs or whatever, and spellcheck/autocomplete full queries.
For lucene this should just work, for solr you need to ensure the QueryConverter doesn't split up your terms... see https://issues.apache.org/jira/browse/SOLR-3143
On the other hand, these suggesters currently work on the whole input, so if you want to suggest queries that have never been searched before, instead you want something that maybe only takes the last N words of context similar to http://googleblog.blogspot.com/2011/04/more-predictions-in-autocomplete.html.
I'm hoping we will provide that style of suggester soon also as an alternative, possibly under https://issues.apache.org/jira/browse/LUCENE-3842.
But keep in mind, thats not suitable for all purposes, so I think its going to likely just be an option. For example, if you are doing e-commerce there is no sense is suggesting products you don't sell :)

Resources