Results 1 to 4 of 4

Thread: [RESOLVED] Using hoot to create indexes of documents in a folder

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2021
    Posts
    69

    Resolved [RESOLVED] Using hoot to create indexes of documents in a folder

    I am trying to build an index of documents in a folder with hOOt. I am getting an error at this line: Dim hOOters As New hOOt(SearchFolder, "documents", True)
    saying "type expected"

    Code:
    Imports hOOt
    Public Class CreateIndex
    
        Private Sub BtnClose_Click(sender As Object, e As EventArgs) Handles BtnClose.Click
            Close()
        End Sub
    
        Private Sub CreateIndex_Load(sender As Object, e As EventArgs) Handles Me.Load
    
            Dim SearchFolder As String = "C:\INFORMATIE OPSLAG - GERUBRICEERD\2016"
    
            Dim hOOters As New hOOt(SearchFolder, "documents", True)
    
            hOOters.FreeMemory(False) ' will free bitmap memory
    
            Dim dirInfo As New IO.DirectoryInfo(SearchFolder)
            Dim files As IO.FileInfo() = dirInfo.GetFiles()
            'Dim file As IO.FileInfo
    
            For Each Filename In files
    
                If Filename.Extension = ".pdf" Or Filename.Extension = ".PDF" Then
                    Dim fileReader As String
                    fileReader = My.Computer.FileSystem.ReadAllText(Filename.ToString)
                    hOOters.Index(New Document(Filename, fileReader), True)
                End If
            Next
    
            'optimize the bitmap index size
            hOOters.OptimizeIndex()
    
        End Sub
    End Class
    https://www.codeproject.com/Articles...mozTocId150639

  2. #2
    Frenzied Member
    Join Date
    Jul 2011
    Location
    UK
    Posts
    1,334

    Re: Using hoot to create indexes of documents in a folder

    Quote Originally Posted by clausowitz View Post
    I am getting an error at this line: Dim hOOters As New hOOt(SearchFolder, "documents", True)
    Try
    Code:
    Dim hOOters As New RaptorDB.Hoot(SearchFolder, "documents", True)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2021
    Posts
    69

    Re: Using hoot to create indexes of documents in a folder

    Quote Originally Posted by Inferrd View Post
    Try
    Code:
    Dim hOOters As New RaptorDB.Hoot(SearchFolder, "documents", True)
    Code:
    Imports System.IO
    Imports hOOt
    
    Public Class CreateIndex
        Private hOO
        Private Sub BtnClose_Click(sender As Object, e As EventArgs) Handles BtnClose.Click
            Close()
        End Sub
    
        Private Sub CreateIndex_Load(sender As Object, e As EventArgs) Handles Me.Load
    
            hOO = New RaptorDB.Hoot(Path.GetFullPath(txtIndexFolder.Text), "index", True)
            Dim SearchFolder As String = "C:\INFORMATIE OPSLAG - GERUBRICEERD\2016"
    
            Dim hOOters As New RaptorDB.Hoot(SearchFolder, "documents", True)
            '("d:\IndexFolder", "documents", True)
    
            hOOters.FreeMemory(False) ' will free bitmap memory
    
            Dim dirInfo As New IO.DirectoryInfo(SearchFolder)
            Dim files As IO.FileInfo() = dirInfo.GetFiles()
            'Dim file As IO.FileInfo
    
            For Each Filename In files
    
                If Filename.Extension = ".pdf" Or Filename.Extension = ".PDF" Then
                    Dim fileReader As String
                    fileReader = My.Computer.FileSystem.ReadAllText(Filename.ToString)
                    hOOters.Index(New Document(Filename, fileReader), True)
                End If
            Next
    
            'optimize the bitmap index size
            hOOters.OptimizeIndex()
    
        End Sub
    getting a new error with updated code at line hOOters.FreeMemory(False): too many arguments to "Public overloads Sub FreeMemory()

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,657

    Re: Using hoot to create indexes of documents in a folder

    The message "too many arguments" means that you are passing too many values to the method (ie: you have more items inside the brackets than you are allowed).

    In this case you have only one item inside the brackets, so getting this error means that you aren't allowed to pass any values - so remove the False, ie:
    Code:
            hOOters.FreeMemory()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width