Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1047653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:20:08+00:00 2026-05-16T16:20:08+00:00

i want to use an List to store the title, path,… from Documents. I

  • 0

i want to use an List to store the title, path,… from Documents.

I declared the list like this:
Dim MyDocuments As New List(Of Document)

But i don’t really know how to handle the list.
i want to use the list instead of an ReDim Array.

For i = 0 To results - 1 Step 1 ' forschleife zum durchlaufen der Ergebnisse

                            Try


                                MyDocuments.Add(New Document())


                                array_results(i, 0) = hits.Doc(i).Get("title")
                                array_results(i, 0) += hits.Doc(i).Get("doc_typ") 
                                array_results(i, 1) = hits.Doc(i).Get("pfad")
                                'array_results(i, 2) = hits.Doc(i).Get("date_of_create") '
                                array_results(i, 2) = hits.Doc(i).Get("last_change")
                                array_results(i, 3) = CStr(hits.Score(i))
                                array_results(i, 4) = hits.Doc(i).Get("doc_typ")

Can I store the object Document, or do i have to create an own class??
Is there a good tutorial for using the list? (i searched, but didn’t found something good)
Is the List of (T) the right data structure?

but how can i do like mylist(i) ->gettitle() or something like this?

thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:20:08+00:00Added an answer on May 16, 2026 at 4:20 pm

    Yes, you can store your documents in a generic List. Deciding if a List<T> is the right data structure or not depends on what you want to do with it. Maybe if you provide more information someone could come up with a better example. I don’t know VB.NET so i’ll do it in C#.

    // i assume you're using the Document class of Lucene.NET
    List<Document> documents = new List<Document>();   
    
    // add the documents to your collection
    for (i = 0; i < hits.Length(); i++)
    {
        // each result in the list contains a Document 
        // which you can add to your list
        documents.Add(hits.Doc(i));   
    }
    
    // you can search the list for a Document following a specific rule, using lambda expressions
    Document myDoc = documents.Find(d => d.Get("title") == "a value");
    
    // you can get a document by a specific index
    Document myOtherDoc = documents[0];
    
    // you can search the list for multiple Documents following a specific rule, using lambda expressions
    List<Document> myDocs = documents.FindAll(d => d.Get("doc_typ") == "a type");
    

    More information about the List<T> can be found here: http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx

    More information on lambda expressions can be found here: http://msdn.microsoft.com/en-us/library/bb397687.aspx

    This article on SO shows how to use lambdas to search a List<T>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use Amazon web services to store files, and I am new
i want to use a list which will store objects of some type (lets
I want to use List.Find() on a simple collection that does not implement Find().
Why would someone want to use a linked-list over an array? Coding a linked-list
Can anyone explain to me why I would want to use IList over List
In a Android application I want to use Scanner class to read a list
I have a comma delimited list of ids that I want to use to
Using bash, I have a list of strings that I want to use to
In order to choose categories, I want to use dropdown lists. Each list contains
i want use some data from a website with web service. i have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.