SorlNet in vb Application

21 views
Skip to first unread message

Madeleine Jullien

unread,
Jul 11, 2018, 11:07:12 AM7/11/18
to SolrNet

I'm trying to use SolrNet in an application write in vb but I can't find anything on internet.For some part of code I "translate" the C# code into a vb code but there are some lines where I can't do that, for example, I don't know how to use this function "solr.AddWithBoost" because it's required 2 parameters and I can"t find what is the seconde one.

Mauricio Scheffer

unread,
Jul 11, 2018, 1:08:37 PM7/11/18
to sol...@googlegroups.com
Hi Jullien,

The second parameter for AddWithBoost is a Double i.e. the boost value.

Kind regards,
Mauricio


On Wed, Jul 11, 2018 at 4:07 PM Madeleine Jullien <jullien....@gmail.com> wrote:

I'm trying to use SolrNet in an application write in vb but I can't find anything on internet.For some part of code I "translate" the C# code into a vb code but there are some lines where I can't do that, for example, I don't know how to use this function "solr.AddWithBoost" because it's required 2 parameters and I can"t find what is the seconde one.

--
You received this message because you are subscribed to the Google Groups "SolrNet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to solrnet+u...@googlegroups.com.
To post to this group, send email to sol...@googlegroups.com.
Visit this group at https://groups.google.com/group/solrnet.
For more options, visit https://groups.google.com/d/optout.

Madeleine Jullien

unread,
Jul 12, 2018, 4:15:41 AM7/12/18
to SolrNet
In vb, the function is : Function AddWithBoost(docs As IEnumerable(Of KeyValuePair(Of T, Double?)), parameters As AddParameters) As ResponseHeader, but I don't know the type of parameters, If I write '1.0' it says "Impossible to convert a 'Doubld' into a "AddParameters'

Madeleine Jullien

unread,
Jul 12, 2018, 4:57:55 AM7/12/18
to SolrNet
I find how to do this, it was something like this : 
Dim param = New AddParameters With{
.Overwrite = True,
.CommitWithin=True}

Mauricio Scheffer

unread,
Jul 12, 2018, 5:17:38 AM7/12/18
to sol...@googlegroups.com
If that's the only AddWithBoost method you see on your object it might mean you're using the ISolrBasicOperations interface instead of ISolrOperations.
I recommend using the latter.


--
Mauricio

Message has been deleted

Madeleine Jullien

unread,
Jul 12, 2018, 5:35:24 AM7/12/18
to SolrNet

Thank you (it's easier that way). Can you help me with this thing ? I don't know how to use it with vb because the function have not the same name ?

Mauricio Scheffer

unread,
Jul 12, 2018, 5:35:42 AM7/12/18
to sol...@googlegroups.com
In your code, request (or inject) ISolrOperations instead of ISolrBasicOperations from the IoC container.

--
Mauricio


On Thu, Jul 12, 2018 at 10:22 AM Madeleine Jullien <jullien....@gmail.com> wrote:
How can I do this ? (use ISolrOpertations and not ISolrBasicOperations) ?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages