Random Sorting Results In Lucene.Net 2.4?

Oct 21, 2010

How do I sort my results in a random order. my code looks something like this at the moment:

Dim searcher As IndexSearcher = New IndexSearcher(dir, True)
Dim collector As TopScoreDocCollector = TopScoreDocCollector.create(100, True)
searcher.Search(query, collector)
Dim hits() As ScoreDoc = collector.TopDocs.scoreDocs
For Each sDoc As ScoreDoc In hits
'get doc and return
Next

View 1 Replies


Similar Messages:

DataSource Controls :: Random Results From A LINQ To SQL Query?

Jan 23, 2010

I have this LINQ query:

var agnts = (from a in db.agents select new { a.userid, a.name }).Take(10);

How can I get randomly get 10 records from my agents table?

I have tried:

agnts = agnts.OrderBy(n => Guid.NewGuid());

but this doesn't seem to do anything.

View 5 Replies

Forms Data Controls :: Prev And Next On Random Results

May 22, 2010

I have a SqlDataSource that pulls data from a table randomly. When I get this data in a formview, i want to be able to page through it (< prev next >) in that random order. Make sense? So in other words, whenever the query is run, I want it to pull a list from a table in a random order (which I've already got). I just want to be able to click next and prev within that random order?

View 2 Replies

Web Forms :: Sorting Dropdown Results In Code Behind?

Jan 11, 2011

I'm trying to figure out how to grab results from AD (works fine) and then take those results and sort them alphabetically.

[Code]....

View 2 Replies

Sorting And Paging Results Returned By Multiple Resources?

Jan 15, 2010

i m using three web services in my project ... while Webservice1 returns data in a set of 50 records at a time .. the other 2 webservices return the entire resultset .. the consolidated results(20 per page) are to be displayed in sorted fashion...now the query is to find the best way to retrieve the data from the 3 sources while applying the sorting across the consolidated results. I have developed some code for this but am looking for something better ..

View 5 Replies

DataSource Controls ::character To Column Name Then A New String Random Will Auto Insert Into Column Random?

Dec 15, 2010

I create a table as picture below :

when I insert any character to column Name then A new string random will auto insert into column Random (picture below) I had used Trigger but It was error !

I want to column Random use to code :

DECLARE @myid uniqueidentifier
SET @myid = NEWID()
insert into table_1 values(@myid, substring(CONVERT(varchar(255), @myid), 1, 5))

but It must auto like column Number (column Number is Identity)

View 1 Replies

Lucene - Solrnet /.NET Sample Without MVC?

Apr 17, 2010

I am trying to get a handle on Solrnet and interacting an ASP.NET site with a Solr server. However, the sample app (on the code repository) is MVC based ,does anyone know of a version in plain vanilla ASP.NET?

View 1 Replies

.net - Lucene.net Create + Lock Errors In .NET?

May 26, 2010

-Edit- Important: I updated the code to not use obsoluete functions. Now only the NoSuchDirectoryException issue remains

Edit: NOTE i can bypass the NoSuchDirectoryException by creating the folder in a winform app and copy it. However i still have a LockObtainFailedException issue if i dont shut down properly.I have an issue with (Lucene.net 2.9.2

[https://svn.apache.org/repos/asf/lucene/lucene.net/tags/]. It throws a lock exception. After poking around i notice these things.

My code below works in an app bit when calling in Application_Start i get a NoSuchDirectoryException.Not closing the writer (as my code doesnt do below) i WILL get a LockObtainFailedException with the message

Lock obtain timed out: SimpleFSLock@<FULL_PATH> from either app or asp.net

These thread hinted when spawning threads they get less permissions then i do (but! my main thread has problems as well...) and one solution is to impersonate IIS. I am using visual studios 2010. I am not sure how full blown it is but my attempt to impersonate it failed.

So my question is how do i have lucene create the directory and not throw an exception if dont close the writer for some reason (such as power going out)?

http://stackoverflow.com/questions/2341163/why-is-my-lucene-index-getting-locked/2499285#2499285

http://stackoverflow.com/questions/1123517/lucene-net-and-i-o-threading-issue/1123981#1123981

static IndexWriter writer = null;
static void lucene_init()
{
[code].....

View 1 Replies

To Use Lucene (on Linux) And .net (on Windows) At The Same Time?

Jan 13, 2010

I want to start a new project I need performance as well as a neat and robust GUI

about the performance I have around 2 millions documents which I like to index'em by the help of lucene installed on linux due to its performance and security.

and about GUI I'd like to have flexible and professional look website and since I'm experienced with .net I'd like to retrieve the lucene's result and show it in my own way.

I've heard about some RESTful services available inside the lucene but I don't have any clue according to that and how to connect these two together.

how can I connect asp.net to lucene?

View 2 Replies

C# - Finding Open Source Applications That Use Lucene.net?

Jun 11, 2010

I am looking for any open source application that uses lucene.net. I am working on a complicated web application and would like to see how others have implemented lucene.net.

View 2 Replies

How To Handle Very Frequent Updates To A Lucene Index

Nov 4, 2010

Am using Lucene.net 3.0 in my Application which as frequent updates to index.

But when new data on a forum it's not available in the search . it's taking few minutes to update index.
how can i overcome this.....

View 1 Replies

Reindexing A Large SQL Server Database To Lucene?

Feb 24, 2011

We have a web service method which accepts some data and puts it in Lucene index. We use it to index new and updated entries from our asp.net web app.

These entries are stored in a large SQL Server table (20M rows and growing), and I need a way to be able to reindex the whole table in case if current index gets deleted or corrupted. I'm not sure what's the optimal way to retrieve chunks of data from a large table. Currently, we use the fact that the table has PK which is autoincrement, so we get chunks of 1000 rows until it starts to return nothing. Kind of like (in pseudo language):

i = 0
while (true)
{
SELECT col1, col2, col3 FROM mytable WHERE pk between i and i + 1000
.... if result is empty 20 times in a row, break ....
.... otherwise send result to web service to reindex ....
i = i + 1000
}

This way, we don't need to SELECT COUNT(*) which would be a big performance killer, and we just move up the pk values until we stop getting any results. This has it's con: if we have a hole greater than 20,000 values somewhere in the table, it will stop indexing assuming it reached the end, but that's a tradeoff we have to live for now.

way of getting data from a table to index? I would assume we are not the first ones facing this problem - search engines are widely used nowadays :)

View 3 Replies

C# - Running Long Process: Indexing 5GB Docs With Lucene?

May 14, 2010

Situation:I have an ASP .NET application that will search through docs using Lucene. I want to run the initial indexing (the index will be incremental after the initial run so there wont be need to index the whole directory again in future). Currently, I have about 5GB of docs (45000files).Problem: My application times out before completing the process. I have altered the TimeOut like this:HttpContext.Current.Server.ScriptTimeout = 200000;but it still does not complete the process.

View 1 Replies

Lucene.net - Library To Extract Plain Text From Open XML File Formats?

May 6, 2010

Is there a pre-existing library to extract plain text form Open XML file formats (e.g. docx, pptx, and xlsx) files?

I require this to populate a lucene.net index.

I've found this example which extracts text from docx and it seems to work okay. But before building my own solution based on this I was wondering if there's something already available for the other file formats?

View 2 Replies

Forms Data Controls :: Getting The Custom Sorting And Paging With Images To Indicate The Sorting Direction In Gridview

Jul 18, 2010

Moderators Note: THIS ISSUE IS BIG FOR ME AND EVEN IF POSSIBLE, GET THE REPLY FROM THE DESIGNER OF GRIDVIEW. I have been looking for him for long. I am really fed up with reviewing a good lot of web pages on how we can possibly customize the gridview to enable sorting and paging. So many sites have listed out a lot of information and so many guidances. But the problem is that one works out fine and the other is a burden. I really feel bad about being given the job of customizing this kind of a gridview which has no user friendly approach to it. Also, this control is rendered without the pager links inside the <tfoot> tag. I have tried the Pear Pager in php. It is that good and easy to use and compared to that, the gridview in asp.net is the worst ever control i have ever tried so far.

1. i can use the images to indicate the sorting direction
2. I can have the custom pager like

[code]

<<Previous 1 2 3 .. 7 Next >>.

[/code]

When i click the next when i am viewing the page at 3 , the pager links should change as

[code]

<<Previous 2 3 4 .. 7 Next >>

[/code]

Kindly look into this type of requirement and firstly tell me whether this is possible with the gridview control. I would like this request even to be escalated to the designers of the gridview control also, so that Microsoft comes out with a reply THAT WORKS and not the kind of stuff like surfing through a lot of links and pages and finally wasting a lot of days precious time and still breaking the head with this useless control. I have spent a lot of time in searching for a perfect way. Not writing a code that is non-standard. I am really serious b'cos I have spent weeks in customizing this control. If I dont get a solid reply atleast now, I am going to generate all the output by HTML content by custom coding.

View 7 Replies

Visual Studio :: Duplicate Results In "find Results 1" Window?

Jan 26, 2011

In VS2010, when I "find in files", I often get doubled results in my find window.

View 5 Replies

Comparing A Random Value With An Entry?

Nov 4, 2010

i have a simple application which i couldnt run correctly. My codes;

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
protected void Page_Load(object sender, EventArgs e)....

When i run that page, and enter the same number with label1 to textbox1 and click to the button, first label1 changes to another number and so the comparement does not match.

View 6 Replies

Displaying Random Photos?

Oct 22, 2010

How can I diplay random 5 photos in the main page of my site? These photos could be users' photos..

View 8 Replies

Random NullReferenceException From MVC Internals?

Mar 9, 2010

we have an MVC app that is after some time getting to some kind of bad state. I found only a couple of posts with a similar error message and they pointed to not changing up the routing table (after appstart). However this app doesn't mess with the routing table after appstart so that would appear not to be the cause of our problem. Recycling the app makes the error go away... for a time. Got 3 sites (all running of the same codebase) that this is effecting.

Just incase I'm doing something naughty in my application class heres a bit of source:

[Code]....

And the class that inherits from: [Code]....

Stack trace follows:[NullReferenceException: Object reference not set to an instance of an object.]
System.Web.Routing.RouteCollection.GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) +97

View 7 Replies

.net Mvc C# Random Generating Same Number?

Jan 20, 2011

how can i generate different number,it is generating the same number

Random rand = new Random(100000);
rand.Next();

View 5 Replies

How To Generate Random Numbers Manually

Apr 18, 2010

I know there is a class called Random but how do I generate random numbers manually? without using Random class.

View 6 Replies

Security :: Random Exception In A Web Service?

Jan 5, 2010

I'm getting this exception randomly in one webservice, it used to happen in the first call only, and in the second calls and so on it works fine ... and after a while without use the webservice it happens again. It seems to be that when the AppDomain is not loaded, the first time fails... and subsequent calls are ok; when IIS shutdown the AppDomain... the next call will fail again.

[code]....

View 4 Replies

How To Create A Random Password Generator In C#

Mar 11, 2011

I want to create a random password generator in my ASP.NET C# web application.

I have created that but it is applicable only for the integer format. If I give any characters it shows the debugging error as "my input format is wrong".

But i want to enter both string and integer. For example my textbox field may be

[code]....

View 4 Replies

SQL Server :: How To Generate Random Password

Nov 30, 2010

Using Stored Procedure (SQL) Am looking to generate a 10 digit alphanumeric number. How do i proceed.

Example:

132AXD1LKM

AD157LKJ1A

View 3 Replies

How To Generate A Random Number Of 16 Digit

Mar 7, 2010

I want to generate a 16 digit random account number that should be unique in database for every new user of my website. kindly guide me how can i generate a 16 digit unique number.obviouly i understand that i would have to check that number in my database table for uniqueness and if that generated number already exist then i would have to generate it again.

View 11 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved